PHP Class Bolt\Controller\Backend\BackendBase

Author: Carson Full ([email protected])
Inheritance: extends Bolt\Controller\Base
显示文件 Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
before ( Request $request, Silex\Application $app, string $roleRoute = null ) : null | RedirectResponse | Symfony\Component\HttpFoundation\JsonResponse Middleware function to check whether a user is logged on.
connect ( Silex\Application $app )

Protected Methods

Method Description
login ( ) : Login Returns the Login object.
password ( ) : Password Returns the Password object.
render ( $template, array $context = [], array $globals = [] )
setAuthenticationCookie ( Request $request, Response $response, string $token ) : Response Set the authentication cookie in the response.

Private Methods

Method Description
checkFirstUser ( Silex\Application $app, mixed $route ) : null | true | RedirectResponse Check and handle first user set up.
getRoutePermission ( string $route ) : string Temporary hack to get the permission name associated with the route.

Method Details

before() public method

Middleware function to check whether a user is logged on.
public before ( Request $request, Silex\Application $app, string $roleRoute = null ) : null | RedirectResponse | Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request The Symfony Request
$app Silex\Application The application/container
$roleRoute string An overriding value for the route name in permission checks
return null | Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\JsonResponse

connect() public method

public connect ( Silex\Application $app )
$app Silex\Application

login() protected method

Returns the Login object.
protected login ( ) : Login
return Bolt\AccessControl\Login

password() protected method

Returns the Password object.
protected password ( ) : Password
return Bolt\AccessControl\Password

render() protected method

protected render ( $template, array $context = [], array $globals = [] )
$context array
$globals array

setAuthenticationCookie() protected method

Set the authentication cookie in the response.
protected setAuthenticationCookie ( Request $request, Response $response, string $token ) : Response
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response
$token string
return Symfony\Component\HttpFoundation\Response