本文整理匯總了PHP中Sonata\AdminBundle\Admin\AdminInterface::getRouterIdParameter方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminInterface::getRouterIdParameter方法的具體用法?PHP AdminInterface::getRouterIdParameter怎麽用?PHP AdminInterface::getRouterIdParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sonata\AdminBundle\Admin\AdminInterface
的用法示例。
在下文中一共展示了AdminInterface::getRouterIdParameter方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: build
/**
* RouteBuilder that allowes slashes in the ids.
*
* @param \Sonata\AdminBundle\Admin\AdminInterface $admin
* @param \Sonata\AdminBundle\Route\RouteCollection $collection
*/
function build(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('list');
$collection->add('create');
$collection->add('batch');
$collection->add('edit', $admin->getRouterIdParameter() . '/edit', array(), array('id' => '.+'));
$collection->add('delete', $admin->getRouterIdParameter() . '/delete', array(), array('id' => '.+'));
$collection->add('show', $admin->getRouterIdParameter(), array(), array('id' => '.+', '_method' => 'GET'));
// add children urls
foreach ($admin->getChildren() as $children) {
$collection->addCollection($children->getRoutes());
}
}
示例2: build
/**
* @param \Sonata\AdminBundle\Admin\AdminInterface $admin
* @param \Sonata\AdminBundle\Route\RouteCollection $collection
*/
public function build(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('list');
$collection->add('create');
$collection->add('batch');
$collection->add('edit');
$collection->add('delete');
$collection->add('show');
$collection->add('export');
if ($this->manager->hasReader($admin->getClass())) {
$collection->add('history', '/audit-history');
$collection->add('history_view_revision', '/audit-history-view');
}
if ($admin->isAclEnabled()) {
$collection->add('acl', $admin->getRouterIdParameter() . '/acl');
}
// an admin can have only one level of nested child
if ($admin->getParent()) {
return;
}
// add children urls
foreach ($admin->getChildren() as $children) {
$collection->addCollection($children->getRoutes());
}
}
示例3: build
/**
* RouteBuilder that allows slashes in the ids.
*
* {@inheritDoc}
*/
function build(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('list');
$collection->add('create');
$collection->add('batch', null, array(), array('_method' => 'POST'));
$collection->add('edit', $admin->getRouterIdParameter() . '/edit', array(), array('id' => '.+'));
$collection->add('delete', $admin->getRouterIdParameter() . '/delete', array(), array('id' => '.+'));
$collection->add('export');
$collection->add('show', $admin->getRouterIdParameter() . '/show', array(), array('id' => '.+', '_method' => 'GET'));
if ($admin->isAclEnabled()) {
$collection->add('acl', $admin->getRouterIdParameter() . '/acl', array(), array('id' => '.+'));
}
// add children urls
foreach ($admin->getChildren() as $children) {
$collection->addCollection($children->getRoutes());
}
}
示例4: configureRoutes
/**
* {@inheritdoc}
*/
public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('up', $admin->getRouterIdParameter() . '/up')->add('down', $admin->getRouterIdParameter() . '/down');
}
示例5: configureRoutes
/**
* {@inheritdoc}
*/
public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
{
$collection->add('details', $admin->getRouterIdParameter() . '/details');
}