Download the PHP package digiwise/components-mod without Composer
On this page you can find all versions of the php package digiwise/components-mod. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digiwise/components-mod
More information about digiwise/components-mod
Files in digiwise/components-mod
Package components-mod
Short Description Component manager
License MIT
Homepage https://github.com/digitalunited/components
Informations about the package components-mod
Components
Installation
- Install via composer
- Activate plugin
- Configure grunt
Usage
A component folder should be placed in the theme-directory following this structure:
Every component will have their short-code registered and vc_mapping set up.
component.php
A VCComponent have the following structure:
A Standard component have the following structure:
View
In the views, all values returned from "sanetizeDataForRendering" will be accessible.
eg. ['foo' => 'bar'] will be available like
You may also use the component class, referenced as $component. eg:
You may use separate view files depending on the $view-param, if "view" param is specified, $view.view.php will be rendered. Default: view.php
It is possible to split a view file into partials:
Performance
When a slow registration of a component is detected the plugin will show an admin notice. Slow registration could be caused by by 2 reasons:
- Dynamic population of params
- Execution of tasks in the components main method.
If the problem is due to Dynamic population of params there is an easy solution. Just add the following code as an early abort in the function that generates the dynamic params:
It the code above doesn't help the problem probably is that code is executed in the components main function.
Less and coffe, assets
Could be handled with with Grunt/gulp or whatever. See https://github.com/digitalunited/roots for example