PHP Class Bolt\Twig\Handler\AdminHandler

Datei anzeigen Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app )
addData ( string $path, mixed $value ) Add JavaScript data to app['jsdata'].
buid ( ) : string Returns a unique ID.
hattr ( array $attributes ) : string Prepares attributes ready to attach to an html tag.
hclass ( array | string $classes, boolean $raw = false ) : string Generates pretty class attributes.
logLevel ( integer $level ) : string Convert a Monolog log level to textual equivalent.
randomQuote ( ) : string Returns a random quote. Just for fun.
stack ( array | string $types = [] ) : array Return an array with the items on the stack.
testStackable ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean Return whether or not a file is stackable.
trans ( array $args, integer $numArgs ) : string Translate using our __().
ymllink ( string $str, boolean $safe ) : string Create a link to edit a .yml file, if a filename is detected in the string. Mostly for use in Flashbag messages, to allow easy editing.

Method Details

__construct() public method

public __construct ( Silex\Application $app )
$app Silex\Application

addData() public method

Add JavaScript data to app['jsdata'].
public addData ( string $path, mixed $value )
$path string
$value mixed

buid() public method

Returns a unique ID.
public buid ( ) : string
return string UID

hattr() public method

- Handles boolean attributes. - Omits empty attributes if not forced by appending '!' to the name. - JSON encodes array values - Prettied output of class attribute and array data is handled.
public hattr ( array $attributes ) : string
$attributes array
return string Attributes

hclass() public method

Generates pretty class attributes.
public hclass ( array | string $classes, boolean $raw = false ) : string
$classes array | string
$raw boolean
return string Class attribute

logLevel() public method

Convert a Monolog log level to textual equivalent.
public logLevel ( integer $level ) : string
$level integer
return string

randomQuote() public method

Returns a random quote. Just for fun.
public randomQuote ( ) : string
return string

stack() public method

Return an array with the items on the stack.
public stack ( array | string $types = [] ) : array
$types array | string
return array An array of items

testStackable() public method

Return whether or not a file is stackable.
public testStackable ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean
$filename Bolt\Filesystem\Handler\FileInterface | string
return boolean

trans() public method

Translate using our __().
public trans ( array $args, integer $numArgs ) : string
$args array
$numArgs integer
return string Translated content