Download the PHP package tombroucke/wp-sidewheels without Composer
On this page you can find all versions of the php package tombroucke/wp-sidewheels. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tombroucke/wp-sidewheels
More information about tombroucke/wp-sidewheels
Files in tombroucke/wp-sidewheels
Package wp-sidewheels
Short Description Framework for developing application in your WP install.
License
Informations about the package wp-sidewheels
WP Sidewheels
This package provides an easy way to create custom routes (MVC), roles, Custom post types, ... using a config file.
Installation
Add this package to your plugin dependencies
composer require tombroucke/wp-sidewheels
Initialize sidewheels your plugin:
dirname(__FILE__)
is where your config.php file resides.
Add to your plugin activation hook:
Add to your plugin deactivation hook:
add config.php to your plugin root directory
Important notice
After adding new routes, you need to manually flush your rewrite rules.
Example configuration file
MVC
Controller:
For each route, you need to define a callback. This can be an inline function or a controller.
View:
This package uses twig as it's templating engine. You can pass variable to your templates, e.g. 'website'. The route object is also passed in as a variable, so you can use {{ route.title }} for example. You can call public methods from your controller.
By default, the very basic vendor/tombroucke/wp-sidewheels/templates/sidewheels.php
template will be loaded for all endpoints. You can add a sidewheels.php
template in your views directory, or in your theme root directory. You can use the sidewheels_template_paths
filter to load a custom template based on a specific route or other logic.
Filters
Deny access to certain routes
Manipulate title, will override the title in config file
Title can also be set from controller $this->route()->setTitle('title');
, but this filter will override everything.
Add custom functions to be used in your twig templates.
Adding routes
You can add routes outside of the config file:
All versions of wp-sidewheels with dependencies
johnbillion/extended-cpts Version ^5.0
squizlabs/php_codesniffer Version ^3.6