PHP 클래스 CRUDlex\ControllerProvider

It offers this routes: "/resource/static" serving static resources "/{entity}/create" creation page of the entity "/{entity}" list page of the entity "/{entity}/{id}" details page of a single entity instance "/{entity}/{id}/edit" edit page of a single entity instance "/{entity}/{id}/delete" POST only deletion route for an entity instance "/{entity}/{id}/{field}/file" renders a file field of an entity instance "/{entity}/{id}/{field}/delete" POST only deletion of a file field of an entity instance
상속: implements Silex\Api\ControllerProviderInterface
파일 보기 프로젝트 열기: philiplb/crudlex

공개 메소드들

메소드 설명
connect ( Silex\Application $app ) : SilexController\Collection Implements ControllerProviderInterface::connect() connecting this controller.
create ( Silex\Application $app, string $entity ) : Response The controller for the "create" action.
delete ( Silex\Application $app, string $entity, string $id ) : Response The controller for the "delete" action.
deleteFile ( Silex\Application $app, string $entity, string $id, string $field ) : Response The controller for the "delete file" action.
edit ( Silex\Application $app, string $entity, string $id ) : Response The controller for the "edit" action.
renderFile ( Silex\Application $app, string $entity, string $id, string $field ) : Response The controller for the "render file" action.
setLocale ( Request $request, Silex\Application $app, string $locale ) : Response The controller for setting the locale.
show ( Silex\Application $app, string $entity, string $id ) : Response The controller for the "show" action.
showList ( Request $request, Silex\Application $app, string $entity ) : Response The controller for the "show list" action.
staticFile ( Request $request, Silex\Application $app ) : Response The controller for serving static files.

보호된 메소드들

메소드 설명
buildUpListFilter ( Request $request, EntityDefinition $definition, &$filter, boolean &$filterActive, array &$filterToUse, array &$filterOperators ) Builds up the parameters of the list page filters.
getAfterDeleteRedirectParameters ( Request $request, string $entity, string &$redirectPage ) : string>\array Gets the parameters for the redirection after deleting an entity.
getNotFoundPage ( Silex\Application $app, string $error ) : Response Generates the not found page.
modifyEntity ( Silex\Application $app, AbstractData $crudData, Entity $instance, string $entity, boolean $edit ) : Response Validates and saves the new or updated entity and returns the appropriate HTTP response.
modifyFilesAndSetFlashBag ( Silex\Application $app, AbstractData $crudData, Entity $instance, string $entity, string $mode ) : null | RedirectResponse Postprocesses the entity after modification by handling the uploaded files and setting the flash.
setValidationFailedFlashes ( Silex\Application $app, boolean $optimisticLocking, string $mode ) Sets the flashes of a failed entity modification.
setupI18n ( Silex\Application $app ) Setups i18n.
setupRoutes ( Silex\Application $app ) : mixed Setups the routes.
setupTemplates ( Silex\Application $app ) Setups the templates.

메소드 상세

buildUpListFilter() 보호된 메소드

Builds up the parameters of the list page filters.
protected buildUpListFilter ( Request $request, EntityDefinition $definition, &$filter, boolean &$filterActive, array &$filterToUse, array &$filterOperators )
$request Symfony\Component\HttpFoundation\Request the current application
$definition EntityDefinition the current entity definition
$filterActive boolean reference, will be true if at least one filter is active
$filterToUse array reference, will hold a map of fields to integers (0 or 1) which boolean filters are active
$filterOperators array reference, will hold a map of fields to operators for AbstractData::listEntries()

connect() 공개 메소드

Implements ControllerProviderInterface::connect() connecting this controller.
public connect ( Silex\Application $app ) : SilexController\Collection
$app Silex\Application the Application instance of the Silex application
리턴 SilexController\Collection this method is expected to return the used ControllerCollection instance

create() 공개 메소드

The controller for the "create" action.
public create ( Silex\Application $app, string $entity ) : Response
$app Silex\Application the Silex application
$entity string the current entity
리턴 Symfony\Component\HttpFoundation\Response the HTTP response of this action

delete() 공개 메소드

The controller for the "delete" action.
public delete ( 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 delete
리턴 Symfony\Component\HttpFoundation\Response redirects to the entity list page or 404 on invalid input

deleteFile() 공개 메소드

The controller for the "delete file" action.
public deleteFile ( Silex\Application $app, string $entity, string $id, string $field ) : Response
$app Silex\Application the Silex application
$entity string the current entity
$id string the instance id
$field string the field of the file to delete of the instance
리턴 Symfony\Component\HttpFoundation\Response redirects to the instance details page or 404 on invalid input

edit() 공개 메소드

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
리턴 Symfony\Component\HttpFoundation\Response the HTTP response of this action or 404 on invalid input

getAfterDeleteRedirectParameters() 보호된 메소드

Gets the parameters for the redirection after deleting an entity.
protected getAfterDeleteRedirectParameters ( Request $request, string $entity, string &$redirectPage ) : string>\array
$request Symfony\Component\HttpFoundation\Request the current request
$entity string the entity name
$redirectPage string reference, where the page to redirect to will be stored
리턴 string>\array

getNotFoundPage() 보호된 메소드

Generates the not found page.
protected getNotFoundPage ( Silex\Application $app, string $error ) : Response
$app Silex\Application the Silex application
$error string the cause of the not found error
리턴 Symfony\Component\HttpFoundation\Response the rendered not found page with the status code 404

modifyEntity() 보호된 메소드

Validates and saves the new or updated entity and returns the appropriate HTTP response.
protected modifyEntity ( Silex\Application $app, AbstractData $crudData, Entity $instance, string $entity, boolean $edit ) : Response
$app Silex\Application the current application
$crudData AbstractData the data instance of the entity
$instance Entity the entity
$entity string the name of the entity
$edit boolean whether to edit (true) or to create (false) the entity
리턴 Symfony\Component\HttpFoundation\Response the HTTP response of this modification

modifyFilesAndSetFlashBag() 보호된 메소드

Postprocesses the entity after modification by handling the uploaded files and setting the flash.
protected modifyFilesAndSetFlashBag ( Silex\Application $app, AbstractData $crudData, Entity $instance, string $entity, string $mode ) : null | RedirectResponse
$app Silex\Application the current application
$crudData AbstractData the data instance of the entity
$instance Entity the entity
$entity string the name of the entity
$mode string whether to 'edit' or to 'create' the entity
리턴 null | Symfony\Component\HttpFoundation\RedirectResponse the HTTP response of this modification

renderFile() 공개 메소드

The controller for the "render file" action.
public renderFile ( Silex\Application $app, string $entity, string $id, string $field ) : Response
$app Silex\Application the Silex application
$entity string the current entity
$id string the instance id
$field string the field of the file to render of the instance
리턴 Symfony\Component\HttpFoundation\Response the rendered file

setLocale() 공개 메소드

The controller for setting the locale.
public setLocale ( Request $request, Silex\Application $app, string $locale ) : Response
$request Symfony\Component\HttpFoundation\Request the current request
$app Silex\Application the Silex application
$locale string the new locale
리턴 Symfony\Component\HttpFoundation\Response redirects to the instance details page or 404 on invalid input

setValidationFailedFlashes() 보호된 메소드

Sets the flashes of a failed entity modification.
protected setValidationFailedFlashes ( Silex\Application $app, boolean $optimisticLocking, string $mode )
$app Silex\Application the current application
$optimisticLocking boolean whether the optimistic locking failed
$mode string the modification mode, either 'create' or 'edit'

setupI18n() 보호된 메소드

Setups i18n.
protected setupI18n ( Silex\Application $app )
$app Silex\Application the Application instance of the Silex application

setupRoutes() 보호된 메소드

Setups the routes.
protected setupRoutes ( Silex\Application $app ) : mixed
$app Silex\Application the Application instance of the Silex application
리턴 mixed the created controller factory

setupTemplates() 보호된 메소드

Setups the templates.
protected setupTemplates ( Silex\Application $app )
$app Silex\Application the Application instance of the Silex application

show() 공개 메소드

The controller for the "show" action.
public show ( 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 show
리턴 Symfony\Component\HttpFoundation\Response the HTTP response of this action or 404 on invalid input

showList() 공개 메소드

The controller for the "show list" action.
public showList ( Request $request, Silex\Application $app, string $entity ) : Response
$request Symfony\Component\HttpFoundation\Request the current request
$app Silex\Application the Silex application
$entity string the current entity
리턴 Symfony\Component\HttpFoundation\Response the HTTP response of this action or 404 on invalid input

staticFile() 공개 메소드

The controller for serving static files.
public staticFile ( Request $request, Silex\Application $app ) : Response
$request Symfony\Component\HttpFoundation\Request the current request
$app Silex\Application the Silex application
리턴 Symfony\Component\HttpFoundation\Response redirects to the instance details page or 404 on invalid input