Custom shared libraries
You can add custom libraries shared by all packages.
Add the classes in the lib directory from the project root. Create the lib directory if not exists.
Example
<?php
// lib/Tools.php
declare(strict_types=1);
class Tools
{
public function format(string $value): string
{
return ucfirst(strtolower($value));
}
}
You can then instantiate the class anywhere.
<?php
$tools = new Tools();
echo $tools->format('Hello World!');
- Installation
- Configuration
- Add a new package
- Add a new HTML page
- Serve any type of file
- Rewrite a route
- Add a new block
- Data assignment
- Objects and class fallback
- Database
- Console Commands
- Framework tools
- Custom shared libraries
- External libraries with composer
- Forms
- Captcha
- Write content in Markdown
- Static Site Generator