A plugin for templating in CakePHP with HTML value objects, font-icons and useful helpers
MIT License
Published by dereuromark 5 days ago
If routes are enabled, you should be able to navigate to
/admin/templating/icons
and see all your custom (mapped) icons, as well as the icons available.
You can also check the full icon sets available (namespaced ones).
It can also show you possible conflicts (same icon in different sets, here the defined order matters).
For conflicting ones you can use aliasing through the map - or directly use the verbose set:name
syntax where the "other one" is needed.
Aliasing now works by default for all icons that are not conflicting. On conflicts it will use the first one defined in your config.
The order now is as follows:
See the new backend for details.
It also now allows custom title attribute key via titleField
in options, and uses BC title
option from previous icon helper functionality (with deprecation note). You should be using arguments (3rd param) for title
.
Allow FA5 to also use alternative JSON metadata
Included commits: https://github.com/dereuromark/cakephp-templating/compare/0.2.4...0.2.5
Published by dereuromark 7 months ago
Small fixes
Included commits: https://github.com/dereuromark/cakephp-templating/compare/0.2.3...0.2.4
Published by dereuromark 8 months ago
FontAwesome v6 icons can now be read from different types of files.
JSON type has the greatest advantage of also providing aliases by default.
They are now also only pulled for the type (solid, regular, ...) configured.
Published by dereuromark 8 months ago
Add Templating helper with
convenience methods to color the text according to a boolean result/value
Published by dereuromark 8 months ago
Added `HtmlHelper::string() convenience method:
The Html helper can now directly be used to create Html value objects
$html = $this->Html->string('<i>text</i>');
$this->Html->link($html, '/my/url');
Published by dereuromark 11 months ago
Moved value object Html and the trait HtmlStringable one level up:
-use Templating\View\Html\Html;
-use Templating\View\Html\HtmlStringable;
+use Templating\View\Html;
+use Templating\View\HtmlStringable;
Renamed helper traits
-use Templating\View\Helper\HtmlTrait;
-use Templating\View\Helper\FormTrait;
+use Templating\View\Helper\HtmlHelperTrait;
+use Templating\View\Helper\FormHelperTrait;
The value objects should be safe for serialization using PHP native serialize()
as well as
json_encode()
. As such they should work fine with caching and other forms of transportation
(e.g. API) through different layers.
Published by dereuromark 11 months ago
Added Html value object as convenience wrapper in general:
use Templating\View\Html\Html;
$html = Html::create('<i>text</i>');
$this->Html->link($html, '/my/url');
Published by dereuromark 11 months ago
Use strict_types enabled to make the API more clean.