class BlogController extends ControllerBase

Blog controller

Methods

initialize()

Initialize response headers

boolean
enableCompatibilityView(string $view)

Enables path to Gryphon compatible view, if the view exists AND enableCompatibility is on.

terminateWithView(string $view, array $params = [], array $headers = [])

Terminate the action with a view partial. Will dump output directly to browser, but return the action allowing process to continue.

getHttpCodeDescription($code)

No description

mixed
getRequestSegments(int $i = null)

Return rewrite url segments

array
getJsonData()

Fetch POSTed/PUTed json data

indexAction()

Index handles display of multiple blogs, in the case of multiple blogs.

blogAction()

Blog view action, by default accepts URLs in the form of:

viewAction()

Post view action, by default accepts URLs in the form of:

Details

in ControllerBase at line 16
initialize()

Initialize response headers

in ControllerBase at line 44
protected boolean enableCompatibilityView(string $view)

Enables path to Gryphon compatible view, if the view exists AND enableCompatibility is on.

NOTE: This will mutate the internal view.

Parameters

string $view

Return Value

boolean

in ControllerBase at line 62
protected terminateWithView(string $view, array $params = [], array $headers = [])

Terminate the action with a view partial. Will dump output directly to browser, but return the action allowing process to continue.

Parameters

string $view path
array $params view params
array $headers optional headers

in ControllerBase at line 88
protected getHttpCodeDescription($code)

Parameters

$code

in ControllerBase at line 152
protected mixed getRequestSegments(int $i = null)

Return rewrite url segments

Parameters

int $i segment from 0

Return Value

mixed either all segments as array, or single segment

in ControllerBase at line 172
protected array getJsonData()

Fetch POSTed/PUTed json data

Return Value

array

at line 32
indexAction()

Index handles display of multiple blogs, in the case of multiple blogs.

By default accepts URLs in the form of:

  • blog/

Returns the following items to the view:

  • blogs - collection of {see \Ceo\Models\Blog}

Looks for templates in the following order:

  • blog/index.twig

at line 60
blogAction()

Blog view action, by default accepts URLs in the form of:

  • blog/SLUG

Returns the following items to the view:

  • blog - {see \Ceo\Models\Blog}
  • posts - collection of {see \Ceo\Models\Post}
  • pagination - {see \Ceo\Pagination\Pagination}

Looks for templates in the following order:

  • blog/blog.twig

at line 146
viewAction()

Post view action, by default accepts URLs in the form of:

  • blog/BLOG/YYYY/MM/SLUG
  • blog/BLOG/SLUG

Returns the following items to the view:

  • post - {see \Ceo\Models\Post}

Looks for templates in the following order:

  • blog/post.twig