Created
November 16, 2012 19:14
-
-
Save ChubV/4090022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
repository: | |
class: NSBundle\Repo\MyRepository | |
arguments: [ @service_container ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace NSBundle\Repo; | |
use Symfony\Component\DependencyInjection\Container; | |
class MyRepository | |
{ | |
public function __construct(Container $c) | |
{ | |
$params = $c->get('request')->attributes->get('_route_params'); | |
$id = $params['id']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment