You can install using composer.
composer require nos86/cakephp3-material-design
// config/bootstrap.php
Plugin::load('MaterialDesignTheme', ['bootstrap' => true, 'routes' => true]);
// src/Controller/AppController.php
public function beforeRender(Event $event)
{
$this->viewBuilder()->setTheme('MaterialDesignTheme');
}
// src/View/AppView.php
public function initialize()
{
$this->loadHelper('Form', ['className' => 'MaterialDesignTheme.Form']);
}
// src/Controller/AppController.php
use Cake\Core\Configure;
public function beforeRender(Event $event)
{
// ...
$this->viewBuilder()->setClassName('MaterialDesignTheme.MDB');
}
After you enable the MDBView class in the AppController.php file, you can overwrite any View file, only by creating the Plugin/MDB/
folder inside the Template
folder.
For example, to overwrite the elements files, you must create them as follows:
src/Template/Plugin/MDB/Element/nav-top.ctp
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request