silexphp / Silex

[DEPRECATED -- Use Symfony instead] The PHP micro-framework based on the Symfony Components
https://silex.symfony.com
MIT License
3.58k stars 718 forks source link

url generator service provider #1115

Closed simplyniceweb closed 9 years ago

simplyniceweb commented 9 years ago

I tried to update silex into this version: "silex/silex": "2.0.*@dev" and after reloading the page i got a "class Silex\Provider\UrlGeneratorServiceProvider not found".

Any idea why?

Here's my composer: "silex/silex": "2.0.@dev", "symfony/config": "~2.3", "symfony/console": "~2.3", "symfony/monolog-bridge": "~2.3", "symfony/security": "~2.3", "symfony/translation": "~2.3", "symfony/twig-bridge": "~2.3", "twig/twig": ">=1.8,<2.0-dev", "symfony/yaml": "~2.4", "deralex/yaml-config-service-provider": "1.0.x-dev", "swiftmailer/swiftmailer": "5.3.@dev", "doctrine/dbal": "2.5.@dev", "doctrine/orm": "2.5.@dev", "doctrine/common": "2.5.@dev", "rhumsaa/uuid": "2.8.@dev"

nunocodex commented 9 years ago

Silex\Provider\UrlGeneratorServiceProvider it's removed from 2.0 version, you need to use a router class instead.

simplyniceweb commented 9 years ago

Any documentation about router class for silex? so i can work with silex 2.0?

Thanks!

nunocodex commented 9 years ago

Follow here: https://groups.google.com/forum/#!topic/silex-php/OMbKVBkhH70

argentinaluiz commented 9 years ago

The doc of Silex need updated! This promoting the framework.

nunocodex commented 9 years ago

For the 2.0 doc true, but for now still in development so you can use with warning :)

argentinaluiz commented 9 years ago

Yes @namaless, however, the page http://silex.sensiolabs.org/ need updated. Some thing changed from 2010.

simplyniceweb commented 9 years ago

I really do agree with @argentinaluiz. updated documentation is a must, updating into a newer version is useless if you can't apply it or not even knowing what's up with the updates or why i'm having such errors or warnings, this should be highlighted on the silex webpages e.g. changelogs, why, when, what or any alternatives etc.

henrikbjorn commented 9 years ago

@argentinaluiz @simplynice25 there is no release of the 2.0 branch yet, and therefor the documentation is up to date with the 1.x releases.

As far as i know there isnt really anything outdated documentation for the 1.x releases.

nunocodex commented 9 years ago

@henrikbjorn I think him talking about the date in the bottom of screen, the docs is updated btw.

fabpot commented 9 years ago

Closing as the docs for 2.0 will be updated/published when it's ready. For now, people should use 1.2 or 1.3

chriswgerber commented 8 years ago

Silex is now on 2.0 and there is zero documentation of the change.

For those stumbling across this, use:

$app->register(new Silex\Provider\RoutingServiceProvider());

Then you can access $app['url_generator']->generate('example').

k00ni commented 7 years ago

@ThatGerber: thanks for the hint.

FedericoBiccheddu commented 7 years ago

Even using $app->register(new Silex\Provider\RoutingServiceProvider()); there is no way to generate urls from a twig template.

Is there any fix for this?

mathroc commented 7 years ago

@FedericoBiccheddu have you tried this : http://silex.sensiolabs.org/doc/2.0/providers/twig.html#symfony-components-integration ?

FedericoBiccheddu commented 7 years ago

@mathroc yes, I did read it. The problem was a syntax error caused by my IDE.

Sorry for the unnecessary bump.