Sitelet https://github.com/dereuromark/cakephp-templating/releases
Skip to content

Releases: dereuromark/cakephp-templating

0.2.15

Choose a tag to compare

@dereuromark dereuromark released this 02 Oct 13:03
6879ab2

Fixes

  • Icon sets configured with only svgPath now collect their icon names from it. An SVG directory (for example the individual FontAwesome 7 svgs/solid/ files) no longer raises file_get_contents(): ... Is a directory on 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).
  • IconCollection can be used standalone without passing separator; it defaults to : (#20).
  • IconSnippetHelper::neighbors() uses extractable translation keys Previous {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.translateAutoTitle to true to restore it globally, or pass translate => true per call. Titles you pass yourself are still translated (#16).
  • Icon title translations now use the plugin's template domain instead of the app's default domain. Move existing icon title translations into template.po; a template.pot file now ships with the plugin (#15).

Full Changelog: 0.2.14...0.2.15

0.2.14

Choose a tag to compare

@dereuromark dereuromark released this 03 May 15:31
b88aeea

Improvements

API changes

  • Raised minimum PHP version to 8.2.
  • Dropped the deprecated Serializable interface from View\Html. __serialize / __unserialize continue 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_-]* in SvgRenderTrait::getSvgPath() and HeroiconsIcon::getSvgPath(), so ../, backslash, dot or slash payloads can no longer be spliced into the resolved SVG path.
  • Resolved candidates are realpath-confined to the configured svgPath base directory; falls back to the existing "icon not found" error when the base directory does not exist on disk.
  • The Heroicons style config 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

Choose a tag to compare

@dereuromark dereuromark released this 18 Nov 13:00

Fixes

  • Allow title false for Icon rendering

Full Changelog: 0.2.12...0.2.13

0.2.12

Choose a tag to compare

@dereuromark dereuromark released this 13 Oct 10:06

Improvements

  • Simpler svgPath config: Set to true if it equals the path.

Full Changelog: 0.2.11...0.2.12

0.2.11

Choose a tag to compare

@dereuromark dereuromark released this 09 Oct 13:39
2c74d61

Improvements

  • SvgRender: Allow merging of custom attributes into existing ones by @josbeir in #6
  • Add support for svg inlining by @josbeir in #7

New Contributors

Full Changelog: 0.2.10...0.2.11

0.2.10

Choose a tag to compare

@dereuromark dereuromark released this 08 Oct 17:05
ed46339

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

Choose a tag to compare

@dereuromark dereuromark released this 08 Oct 11:01

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

Choose a tag to compare

@dereuromark dereuromark released this 07 May 16:02
d86385f

Improvements

  • Removed deprecation usage

0.2.7

Choose a tag to compare

@dereuromark dereuromark released this 03 Mar 17:54
bd73c8b

Improvements

  • Allow caching icon collections for performance in production mode.
  • Add Templating helper yesNo() convenience method.

0.2.6

Choose a tag to compare

@dereuromark dereuromark released this 22 Oct 20:49
6ea4eb2

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.