Class TemplateExtras
This class contains some useful extra template methods.
Methods summary
public
|
|
public
array
|
#
breadcrumbs( Closure|Closure[] $callbacks = null )
Generate an array of breadcrumbs, based on the current page.
Generate an array of breadcrumbs, based on the current page.
Each item in the array is a hash containing 'title' and 'url' (which
might be null).
You can use this to generate nice breadcrumb lists in your page.
Parameters
- $callbacks
Set of user-defined callbacks that can
return breadcrumbs. If any of the supplied callbacks
return data, then their data will be used rather than
the defaults supplied by this method. Note that
the initial 'Home' crumb is always included
Returns
array
|
public
string
|
#
partial( string $file, array $variables = array() )
Render a view partial.
Parameters
- $file
- Partial file name
- $variables
- $params Optional variables to make available to partial
Returns
string Rendered partial
|
public
string
|
#
archiveTitle( array $config = array() )
Get a nice title for an archive page.
Get a nice title for an archive page.
Will return nice titles for taxonomy or date archive pages.
Optionally config this method with formatting:
- default ('Archive'): Title to display if archive page is not date or taxonomy
- prefix (''): Text to prefix your title with
- suffix (''): Text to suffix your title with
- year_format ('Y'): Date format for 'year' archive pages
- month_format ('F Y'): Date format for 'month' archive pages
- day_format ('js F Y'): Date format for 'day' archive pages
Parameters
- $config
- Optional formatting config, as described above
Returns
string Archive title
|