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
Mantle includes a classname helper function that can be used to generate a CSS
📄️ Collections
Mantle includes Laravel's collections package
📄️ Conditionable
Conditionable is a trait that provides a way to conditionally call a closure
📄️ Hookable
Hookable is a trait that will automatically register methods on your class with
📄️ Macroable
Macros allow you to add methods to classes from outside the class. This is
📄️ Type-safe Options and Object Metadata
When working with WordPress, you may need to retrieve and manipulate options or
📄️ Pipeline
Mantle includes a pipeline class that uses the pipeline pattern to process a
📄️ 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.