Support
The mantle-framework/support
package provides a set of classes and traits that
can be used to extend the functionality of your classes/application. This
package doesn't require the rest of the framework in anyway and is a great
addition to any WordPress project.
Installation
You can install the package via Composer:
composer require mantle-framework/support
Features
The following are features included in the mantle-framework/support
package:
📄️ Classname
A classname helper function for generating CSS class names based on various conditions and inputs.
📄️ Collections
Mantle includes Laravel's collections package
📄️ Conditionable
Conditionable is a trait that provides a way to conditionally call a closure
📄️ Helpers
General helpers for development.
📄️ Hookable
Hookable is a trait that will automatically register methods on your class with
📄️ HTML Manipulation
The HTML class provides methods to query, manipulate, and assert against HTML
📄️ Macroable
Macros allow you to add methods to classes from outside the class. This is
📄️ Mixed Options/Meta Data
Handle mixed data types in a type-safe manner for options and object metadata.
📄️ Pipeline
Execute a series of tasks in a specific order using the pipeline pattern.
📄️ Singleton
A singleton is a class that can only be instantiated once. It is often used to
📄️ Stringable
The Stringable class exists in the Mantle\Support namespace and is used to create a stringable object from a string or a stringable object.