Releases: dereuromark/cakephp-templating
Release list
0.2.15
Fixes
- Icon sets configured with only
svgPathnow collect their icon names from it. An SVG directory (for example the individual FontAwesome 7svgs/solid/files) no longer raisesfile_get_contents(): ... Is a directoryon helper init, and a JSON SVG map no longer silently disables auto-prefixing (#20). - The in-memory collector cache no longer mixes up results when two icon sets read the same path through different collectors (#20).
IconCollectioncan be used standalone without passingseparator; it defaults to:(#20).IconSnippetHelper::neighbors()uses extractable translation keysPrevious {name}/Next {name}instead of runtime-concatenated ones. Default labels now read "Previous Record" / "Next Record" (#16).
Improvements
- Auto-generated icon titles (the humanized icon name) are no longer translated by default. Set
Icon.translateAutoTitletotrueto restore it globally, or passtranslate => trueper call. Titles you pass yourself are still translated (#16). - Icon title translations now use the plugin's
templatedomain instead of the app's default domain. Move existing icon title translations intotemplate.po; atemplate.potfile now ships with the plugin (#15).
Full Changelog: 0.2.14...0.2.15
0.2.14
Improvements
API changes
- Raised minimum PHP version to 8.2.
- Dropped the deprecated
Serializableinterface fromView\Html.__serialize/__unserializecontinue to round-trip cleanly, so cached/serialized values keep working.
FontAwesome 7 support
Added FontAwesome7Icon (alias of FontAwesome6Icon). FA7 ships the same CSS class syntax and metadata format as v6, so the existing collector parses both JSON metadata and SVG sprites from fortawesome/fontawesome-free@7.x out of the box (#13).
Hardened SVG icon resolution
- Icon names are now validated against
[a-zA-Z0-9][a-zA-Z0-9_-]*inSvgRenderTrait::getSvgPath()andHeroiconsIcon::getSvgPath(), so../, backslash, dot or slash payloads can no longer be spliced into the resolved SVG path. - Resolved candidates are
realpath-confined to the configuredsvgPathbase directory; falls back to the existing "icon not found" error when the base directory does not exist on disk. - The Heroicons
styleconfig key is allow-listed against the directories Heroicons ships (outline,solid,mini,24/outline,24/solid,20/solid,16/solid).
Standard usage is unaffected — this only matters if your application passes user-controlled values (query string, DB content) into the icon helper (#14).
Full Changelog: 0.2.13...0.2.14
0.2.13
0.2.12
Improvements
- Simpler
svgPathconfig: Set totrueif it equals thepath.
Full Changelog: 0.2.11...0.2.12
0.2.11
0.2.10
Improvements
- Added Lucide and Heroicons icon sets (incl SVG)
- Added support for SVG for all types (latest versions)
- Added cache layer as optional feature when using SVG
- Added SVG map support (single file to read and cache per icon set)
Full Changelog: 0.2.9...0.2.10
0.2.9
Improvements
- Added SVG support for BS font icons
'Icon' => [
'sets' => [
'bs' => [
'class' => \Templating\View\Icon\BootstrapIcon::class,
'svgPath' => WWW_ROOT . 'css/bootstrap-icons/icons/',
],
...
],
],When svgPath is configured, the icon will be rendered as an inline SVG element loaded from the configured directory.
Full Changelog: 0.2.8...0.2.9
0.2.8
0.2.7
Improvements
- Allow caching icon collections for performance in production mode.
- Add Templating helper
yesNo()convenience method.
0.2.6
Improvements
Backend added
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.
Icon::render()
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:
- map (custom aliasing)
- primary set
- other sets
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.