public edit ( Silex\Application $app, string $entity, string $id ) : |
||
$app | Silex\Application | the Silex application |
$entity | string | the current entity |
$id | string | the instance id to edit |
Результат | the HTTP response of this action or 404 on invalid input |
public function edit(Application $app, $entity, $id)
{
$crudData = $app['crud']->getData($entity);
$instance = $crudData->get($id);
if (!$instance) {
return $this->getNotFoundPage($app, $app['translator']->trans('crudlex.instanceNotFound'));
}
return $this->modifyEntity($app, $crudData, $instance, $entity, true);
}