Skip to content

Commit c076338

Browse files
committed
tweaked admin breadcrump
1 parent 7962e2b commit c076338

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Admin/RedirectRouteAdmin.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Sonata\AdminBundle\Datagrid\ListMapper;
1717
use Sonata\AdminBundle\Form\FormMapper;
1818
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
19+
use Symfony\Cmf\Bundle\RoutingBundle\Model\Route;
1920

2021
class RedirectRouteAdmin extends Admin
2122
{
@@ -63,4 +64,11 @@ public function getExportFormats()
6364
return array();
6465
}
6566

67+
public function toString($object)
68+
{
69+
return $object instanceof Route && $object->getId()
70+
? $object->getId()
71+
: $this->trans('link_add', array(), 'SonataAdminBundle')
72+
;
73+
}
6674
}

Admin/RouteAdmin.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
2020
use Symfony\Component\HttpFoundation\Request;
2121
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
22+
use Symfony\Cmf\Bundle\RoutingBundle\Model\Route;
2223
use PHPCR\Util\PathHelper;
2324

2425
class RouteAdmin extends Admin
@@ -185,4 +186,12 @@ protected function validateDefaultsTemplate(ErrorElement $errorElement, $object)
185186
->end();
186187
}
187188
}
189+
190+
public function toString($object)
191+
{
192+
return $object instanceof Route && $object->getId()
193+
? $object->getId()
194+
: $this->trans('link_add', array(), 'SonataAdminBundle')
195+
;
196+
}
188197
}

0 commit comments

Comments
 (0)