CRUDlex\ControllerProvider::edit PHP Method

edit() public method

The controller for the "edit" action.
public edit ( Silex\Application $app, string $entity, string $id ) : Response
$app Silex\Application the Silex application
$entity string the current entity
$id string the instance id to edit
return Symfony\Component\HttpFoundation\Response 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);
    }