A CakePHP helper to handle some common format topics.
Include helper in your AppView class as
$this->addHelper('Tools.Format', [
...
]);
You can store default configs also in Configure key 'Format'.
Display font icons using the default namespace or an already prefixed one.
echo $this->Html->link(
$this->Format->icon('view'),
$url,
$attributes
);
You can alias them via Configure for more usability:
// In app.php
'Format' => [
'fontIcons' => [
'login' => 'fa fa-sign-in',
'logout' => 'fa fa-sign-out',
'translate' => 'fa fa-language',
],
],
// in the template
echo $this->Format->icon('translate', ['title' => 'Translate this']);
Displays yes/no symbol for e.g. boolean values as more user friendly representation.
Display a colored result based on the 2nd argument being true or false.
echo $this->Format->ok($text, $bool, $optionalAttributes);
Display a disabled link with a default title.
Translate a result array into a HTML table.