Skip to content

v2.0.0

Latest

Choose a tag to compare

@nabeghe nabeghe released this 12 Sep 19:50

Risma 2.0.0 is here! This major release introduces 22 new built-in template helpers, powerful core engine capabilities, and optimized distribution — with 100% backward compatibility (zero breaking changes) for PHP >= 7.4.

🚀 What's New

  • 22 New Built-in Functions:

    • Conditionals & Logic: ternary, coalesce, if_equals, if_not_equals, if_gt, if_gte, if_lt, if_lte, if_starts_with, if_ends_with, if_contains
    • Smart Pluralization: Full multilingual plural helper (zero, singular, plural forms)
    • Multibyte UTF-8 Text: upper, lower, title, length
    • Collections & Strings: get, count, join, slug, mask, truncate, wrap, replace
  • Core Engine Features:

    • Shared Global Variables: share(), shareMany(), getGlobals(), clearGlobals()
    • Custom Delimiters: Configure custom opening/closing tags via setDelimiters() (e.g. [: :])
    • Static Helpers: Instant execution with Risma::quick() and fluent Risma::make()
    • Template Introspection: Inspect required template parameters with extractVariables()
    • Configurable Recursion Depth: Protect against recursion with setMaxDepth()
    • Safe Objects/Arrays: Graceful JSON encoding instead of string conversion errors
    • Fluent & Batch Registration: Fluent chaining on addFunc, addClass, addObject + batch add*s()
  • Quality & Infrastructure:

    • Full CI test matrix across PHP 7.4 through PHP 8.4 (162 tests passing)
    • Interactive documentation portal powered by MkDocs Material
    • Optimized Composer package distribution via .gitattributes

👉 Full Documentation & Interactive Examples: nabeghe.github.io/risma-php