PHP Class Jarves\PageResponseFactory

Datei anzeigen Open project: jarves/jarves Class Usage Examples

Public Methods

Method Description
__construct ( Jarves $jarves, PageStack $pageStack, StopwatchHelper $stopwatch, Container $assetCompilerContainer, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Symfony\Component\Templating\EngineInterface $templating, EditMode $editMode, Router $router, Cacher $cacher )
create ( $data = '' ) : PageResponse
createFromPage ( Node | string | integer $page, string | array | null $contents = null ) : PageResponse
createFromPageWithBody ( string $view, array $parameters = [], Node $page = null ) : PageResponse Creates a new PageResponse object based on a Node object.
createFromRoute ( null $routeName = null, string | array | null $contents = null ) : PageResponse Creates a new PageResponse object based on the current found route (using Symfony's router) or using $routeName.
createFromRouteWithBody ( string $view, array $parameters = [], null | string $routeName = null ) : PageResponse Creates a new PageResponse object based on the current found route (using Symfony's router) or using $routeName.
createPageFromRoute ( string | null $routeName = null ) : Node Creates a Node object based on given $routeName or current route.
createPluginResponse ( $data = '' ) : PageResponse

Method Details

__construct() public method

public __construct ( Jarves $jarves, PageStack $pageStack, StopwatchHelper $stopwatch, Container $assetCompilerContainer, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Symfony\Component\Templating\EngineInterface $templating, EditMode $editMode, Router $router, Cacher $cacher )
$jarves Jarves
$pageStack PageStack
$stopwatch StopwatchHelper
$assetCompilerContainer Jarves\AssetHandler\Container
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$templating Symfony\Component\Templating\EngineInterface
$editMode EditMode
$router Symfony\Component\Routing\Router
$cacher Jarves\Cache\Cacher

create() public method

public create ( $data = '' ) : PageResponse
return PageResponse

createFromPage() public method

public createFromPage ( Node | string | integer $page, string | array | null $contents = null ) : PageResponse
$page Jarves\Model\Node | string | integer Node model, url or node id. Use Jarves\Model\Node::createPage()
$contents string | array | null
return PageResponse

createFromPageWithBody() public method

If you've a theme then you could specify "theme" at the route options (to have a custom doctype/base template) Note: The actual rendering of $view is delayed to the PageResponse::prepare() which is called shortly before sending the request.
public createFromPageWithBody ( string $view, array $parameters = [], Node $page = null ) : PageResponse
$view string
$parameters array
$page Jarves\Model\Node
return PageResponse

createFromRoute() public method

You need to define at your routes additional options: title, theme, layout.
public createFromRoute ( null $routeName = null, string | array | null $contents = null ) : PageResponse
$routeName null Per default current route name, if available
$contents string | array | null
return PageResponse

createFromRouteWithBody() public method

If you've a theme then you could specify "theme" at the route options (to have a custom doctype/base template) Note: The actual rendering of $view is delayed to the PageResponse::prepare() which is called shortly before sending the request.
public createFromRouteWithBody ( string $view, array $parameters = [], null | string $routeName = null ) : PageResponse
$view string
$parameters array
$routeName null | string
return PageResponse

createPageFromRoute() public method

Creates a Node object based on given $routeName or current route.
public createPageFromRoute ( string | null $routeName = null ) : Node
$routeName string | null
return Jarves\Model\Node

createPluginResponse() public method

public createPluginResponse ( $data = '' ) : PageResponse
return PageResponse