Skip to content

Instantly share code, notes, and snippets.

@ChubV
Created November 16, 2012 19:14
Show Gist options
  • Save ChubV/4090022 to your computer and use it in GitHub Desktop.
Save ChubV/4090022 to your computer and use it in GitHub Desktop.
services:
repository:
class: NSBundle\Repo\MyRepository
arguments: [ @service_container ]
<?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