- 10 Apr, 2011 2 commits
-
-
Fabien Potencier authored
* igorw/httpexception: rename BaseHttpException to HttpException
-
Igor Wiedler authored
-
- 06 Apr, 2011 1 commit
-
-
Jeremy Mikola authored
Dashes are common in URL patterns, so it would be helpful to convert them to underscores for default route generation. Any invalid characters (according to Symfony\Component\Routing\RouteCollection) should be stripped entirely, lest an exception is raised.
-
- 05 Apr, 2011 2 commits
-
-
Fabien Potencier authored
If a route ends with a / and the user forgets the / (and a similar route without a / does not exist), then, the user will be redirected to the real URL: If you have a /doc/ URL pattern, a request to /doc will redirect you to /doc/ This is especially useful for the root URL (/): /index.php (which does not make sense as the path info is / at a minimum) redirects to /index.php/
-
Fabien Potencier authored
-
- 04 Apr, 2011 3 commits
-
-
Fabien Potencier authored
-
Fabien Potencier authored
-
Fabien Potencier authored
* igorw/docs: [docs] note that twig is not included [docs] add Extension suffix to extension titles [docs] some documentation for the UrlGeneratorExtension [docs] better examples for the extensions chapter [docs] remove reference to symfony_bridges in TwigExtension docs [docs] move extension documentation to sub-directory [docs] remove _exts [docs] more on routes and twig [docs] initial documentation draft
-
- 03 Apr, 2011 7 commits
-
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
- 02 Apr, 2011 3 commits
-
-
Fabien Potencier authored
-
Fabien Potencier authored
-
Bulat Shakirzyanov authored
-
- 01 Apr, 2011 2 commits
-
-
Igor Wiedler authored
-
Igor Wiedler authored
-
- 31 Mar, 2011 1 commit
-
-
Fabien Potencier authored
-
- 30 Mar, 2011 2 commits
-
-
Igor Wiedler authored
note: only twig and monolog extensions have been documented so far
-
Fabien Potencier authored
-
- 29 Mar, 2011 6 commits
-
-
Fabien Potencier authored
-
Fabien Potencier authored
* igorw/extension-tests: [UrlGeneratorExtension] initial test case [SessionExtension] initial test case [TwigExtension] initial test case
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
-
- 28 Mar, 2011 4 commits
-
-
Fabien Potencier authored
-
Fabien Potencier authored
-
Fabien Potencier authored
Usage: $app = new Application(); $app->register(new TranslationExtension(), array( 'translation.class_path' => '...', )); $app['translator.messages'] = array( 'en' => array( 'apple' => 'apple', ), 'fr' => array( 'apple' => 'pomme', ), ); $app['locale'] = 'fr'; echo $app['translator']->trans('apple'); If you use the Symfony Bridge extension, some tags and filters are also automatically available in templates: $templates = array( 'index' => '{% trans %}apple{% endtrans %}' );
-
Fabien Potencier authored
For now, it allows the Twig extension to register the Routing Twig extension: $app = new Application(); $app->register(new SymfonyBridgesExtension(), array( 'symfony_bridges.class_path' => '...', )); $app->register(new UrlGeneratorExtension()); $app->register(new SessionExtension()); $app->register(new TwigExtension(), array(...)); You can now use {{ path() }} in templates to generate URLs. The order of registration of the extensions is significant.
-
- 27 Mar, 2011 7 commits
-
-
Fabien Potencier authored
-
Fabien Potencier authored
* igorw/urlgenerator: [UrlGeneratorExtension] service for generating URLs for routes
-
Fabien Potencier authored
* igorw/beforefilter-httpexception: [Application] onSilexBefore should fire on BaseHttpException
-
Igor Wiedler authored
Usage example: $app->register(new UrlGeneratorExtension()); $app->get('/hello/:name', function($name) { return "Hello $name!"; }) ->bind('hello'); $app->get('/go', function() use ($app) { $url = $app['url_generator']->generate('hello', array('name' => 'Fabien')); return $app->redirect($url); }); Thanks to @choffmeister.
-
Igor Wiedler authored
-
Igor Wiedler authored
-
Igor Wiedler authored
Sample usage: $app = new Application(); $app->register(new MonologExtension(), array( 'monolog.class_path' => __DIR__.'/vendor/monolog/src', 'monolog.logfile' => __DIR__.'/application.log', )); $app->get('/hello', function() use ($app) { $app['monolog']->addDebug('currently at hello'); return 'Hello World!'; }); $app->get('/error', function() { throw new RuntimeException('Some error'); }); $app->run();
-