3ev Core Wordpress library API
  • Namespace
  • Class

Namespaces

  • Tev
    • Application
      • Bootstrap
    • Author
      • Model
    • Contracts
    • Database
      • CustomTables
    • Field
      • Model
      • Util
    • Plugin
      • Action
      • Shortcode
    • Post
      • Model
      • Repository
    • Taxonomy
      • Model
      • Repository
    • Term
      • Model
      • Repository
    • Util
    • View
      • Exception
  • None

Classes

  • TemplateExtras

Class TemplateExtras

This class contains some useful extra template methods.

Namespace: Tev\Util
Located at Tev/Util/TemplateExtras.php

Methods summary

public
# __construct( Tev\Post\Factory $postFactory )

Constructor.

Constructor.

Inject dependencies.

Parameters

$postFactory
Post object factory
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.

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
3ev Core Wordpress library API API documentation generated by ApiGen