PHP Class Flint\Controller\Controller

Inheritance: extends Flint\PimpleAware
Datei anzeigen Open project: flint/flint Class Usage Examples

Public Methods

Method Description
abort ( $statusCode, $message = '', array $headers = [] )
createForm ( string | FormTypeInterface $type, mixed $data = null, array $options = [] ) : Form Creates and returns a Form instance from the type of the form.
createFormBuilder ( mixed $data = null, array $options = [] ) : FormBuilder Creates and returns a form builder instance
generateUrl ( $name, array $parameters = [], $reference = UrlGeneratorInterface::ABSOLUTE_PATH )
get ( string $id ) : mixed
getUser ( ) : mixed Get a user from the Security Context
has ( string $id ) : boolean
redirect ( $url, $statusCode = 302 )
render ( $name, array $context = [] )
text ( string $text, integer $statusCode = 200, array $headers = [] ) : Response Creates a normal response with the given text and statusCode

Protected Methods

Method Description
createNotFoundException ( string $message = 'Not Found' ) : Exception This will result in a 404 response code.
getRequest ( ) : Request

Method Details

abort() public method

See also: Silex\Application::abort()
public abort ( $statusCode, $message = '', array $headers = [] )
$headers array

createForm() public method

Creates and returns a Form instance from the type of the form.
public createForm ( string | FormTypeInterface $type, mixed $data = null, array $options = [] ) : Form
$type string | FormTypeInterface The built type of the form
$data mixed The initial data for the form
$options array Options for the form
return Symfony\Component\Form\Form

createFormBuilder() public method

Creates and returns a form builder instance
public createFormBuilder ( mixed $data = null, array $options = [] ) : FormBuilder
$data mixed The initial data for the form
$options array Options for the form
return Symfony\Component\Form\FormBuilder

createNotFoundException() protected method

This will result in a 404 response code.
protected createNotFoundException ( string $message = 'Not Found' ) : Exception
$message string
return Exception

generateUrl() public method

See also: Symfony\Component\Routing\RouterInterface::generate()
public generateUrl ( $name, array $parameters = [], $reference = UrlGeneratorInterface::ABSOLUTE_PATH )
$parameters array

get() public method

public get ( string $id ) : mixed
$id string
return mixed

getRequest() protected method

protected getRequest ( ) : Request
return Symfony\Component\HttpFoundation\Request

getUser() public method

Get a user from the Security Context
public getUser ( ) : mixed
return mixed

has() public method

public has ( string $id ) : boolean
$id string
return boolean

redirect() public method

See also: Silex\Application::redirect()
public redirect ( $url, $statusCode = 302 )

render() public method

public render ( $name, array $context = [] )
$context array

text() public method

Creates a normal response with the given text and statusCode
public text ( string $text, integer $statusCode = 200, array $headers = [] ) : Response
$text string
$statusCode integer
$headers array
return Symfony\Component\HttpFoundation\Response