This seems to have changed from the tutorial. Try this:
<?php echo $view->get('router')->generate('register',array()) ?>
On 28 Aug., 12:09, Stephan Ebelt <[email protected]> wrote:
> Hello,
>
> I am trying to get the sandbox HelloKernel.php file adopted to the latest HEAD
> of Symfony2 (271b9637). It took a number of things to fix and now I am stuck
> at
> this:
>
> ===
> InvalidArgumentException: The service "router" does not exist. in
> lib/vendor/symfony/src/Symfony/Component/DependencyInjection/Container.php on
> line 185
> Call Stack
> # Time Memory Function Location
> 1 0.0004 326548 {main}( ) ../index_dev.php:0
> 2 0.0068 513336 Symfony\Framework\Kernel->handle( )
> ../index_dev.php:14
> 3 0.0665 1285164 guiDevDebugProjectContainer->getHttpKernelService( )
> ../Kernel.php:209
> 4 0.0665 1285308
> Symfony\Component\DependencyInjection\Container->__call( )
> ../Container.php:0
> 5 0.0666 1285668 Symfony\Component\DependencyInjection\Container->get(
> ) ../Container.php:270
> 6 0.0666 1285756 guiDevDebugProjectContainer->getHttpKernelService( )
> ../Container.php:181
> 7 0.0678 1327476
> guiDevDebugProjectContainer->getEventDispatcherService( )
> ../guiDevDebugProjectContainer.php:78
> 8 0.0762 1617228 Symfony\Framework\Debug\EventDispatcher->__construct(
> ) ../guiDevDebugProjectContainer.php:40
> 9 0.0763 1617228 Symfony\Framework\EventDispatcher->__construct( )
> ../EventDispatcher.php:38
> 10 0.0763 1617768 Symfony\Component\DependencyInjection\Container->get(
> ) ../EventDispatcher.php:32
> 11 0.0764 1617860
> guiDevDebugProjectContainer->getRequestListenerService( )
> ../Container.php:181
> 12 0.0768 1635896 Symfony\Component\DependencyInjection\Container->get(
> ) ../guiDevDebugProjectContainer.php:189
> ===
>
> I put a print_r($this->getServiceIds()); on line 187 in
> ../guiDevDebugProjectContainer.php (in the cache/ dir) and well, there is no
> "router" in this list. Now I am lost at where the router service should be
> coming from? Hints anyone?
>
> perhaps the Framework is not loaded properly? I use its namespace like this
>
> use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
>
> and call
>
> new FrameworkBundle()
>
> in registerBundles(). Has anything changed here?
>
> there is nothing written to logs/dev.log yet.
>
> stephan
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en