Undefined index: provider
On a clean install
[ErrorException]
Notice: Undefined index: provider in /website/vendor/bundles/Sly/UrlShortenerBundle/Config/Config.php line 76
I'm new to Symfony, so this could be due to another issue with my config, but the rest of the app is working fine. If I fix, I'll certainly submit a patch.
Hi!
Have you created a sly_url_shortener entry in your app/config/config.yml file?
https://github.com/Ph3nol/UrlShortenerBundle/blob/master/Resources/doc/usage.markdown#1-configuration-bundle-informations
Your entity seems not to have a defined provider. Can you copy your config.yml file?
Ah, you were right about that. I should have moved into the usage section.
The issue now (and I can open another if you'd like) is Call to a member function getPattern() on a non-object in /website/vendor/bundles/Sly/UrlShortenerBundle/Router/Router.php on line 45
The code in question from my default controller:
$atweet = new Tweet();
$atweet->__set('text', "i am the text");
$atweet->__set('author', "nikki");
$urlShortener = $this->container->get('sly_url_shortener');
$newname = $urlShortener->getShortUrl($atweet);
You can also tell me to f off and figure it out myself. I work in open source, I know you're doing this for free. :)
No problem about helping you! :)
Please, can you past the sly_url_shortener code part you are using into you config.yml file?
I think the problem is you have no route given to your entity declaration.
A route linked to an entity (with giving an ID, a slug or other) has to be given for URL generation.
Example:
My entity Content, which ID is 1, uses the route content_show to generate the final shortened URL. So I have to give content_show as route parameter to make the magic happen! ;)
I don't know if I'm clear, but you can take a look at the base config to discover it: https://github.com/Ph3nol/UrlShortenerBundle/blob/master/Resources/doc/usage.markdown#1-configuration-bundle-informations
(sorry for my poor english...)
You can take a look at the bundle Router class for more informations about the URL construction from the objet/route duo: https://github.com/Ph3nol/UrlShortenerBundle/blob/master/Router/Router.php