Functions

date

Returns a <time> element containing the time. Pass falsy value to format to exclude them from output.

package

Default

Arguments

$date_format

string

$time_format

string

$time

mixed

Optionally pass custom time

« More »

get

Prints a template. Templates can be just about anything, but they must have a function with the name you use to print the template. See sample_template() and sample_template_named_params().

package

Default

deprecated

Arguments

$template

string

Template init function name

$variables

array

Array without string keys, will be passed as function arguments.

Response

mixed

« More »

list_all

Return list of files in path relative to current file.

package

Default

Arguments

$path

string

« More »

load_glob

Load templates from dir using glob.

Usage: load_glob(dirname(FILE) . '/templates/*')

package

Default

Arguments

$directory

string

« More »

output

Outputs a template. Templates are just functions that you can give parameters.

See sample_template() and sample_template_named_params().

package

Default

Arguments

$template

string

$variables

array

« More »

readmore

Returns a <a> element containing the permalink.

package

Default

Arguments

$post_id

mixed

$text

string

« More »

sample_template

Sample template for those unsure. This is the template init function, you could use classes if you wanted. Usage: <?=\rnb\template\get('\rnb\template\sample_template', ['Hello', 'world!']);

package

Default

Arguments

$title

string

$content

string

« More »

sample_template_named_params

Sample template using "named parameters". Usage: <?=\rnb\template\get('\rnb\template\sample_template_named_params', [['title' => 'Hello world!']]);

package

Default

Arguments

$data

array

« More »

save

Return template instead of printing it. Uses get() internally.

package

Default

deprecated

Arguments

$template

string

Function name

$variables

array

Anything you pass with this array will be used as function parameters for the template.

« More »

term

Returns a <a> element containing the "primary" (first) term. Optionally pass and ID or term object to retrieve that term as an element.

package

Default

Arguments

$taxonomy

string

$term

mixed

$options

array

(optional)

« More »

to_string

Returns template output as string, and discards any return value.

package

Default

Arguments

$template

string

$variables

array

« More »