nos86/cakephp3-material-design

CakePHP 3.x Material Design Theme.

Installs: 22

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 1

Open Issues: 0

Language:JavaScript

Type:cakephp-plugin

dev-master 2018-01-05 15:53 UTC

This package is not auto-updated.

Last update: 2024-07-07 04:36:40 UTC


README

cakephp3-MaterialDesign

Installation

You can install using composer.

composer require nos86/cakephp3-material-design

Enable Plugin

// config/bootstrap.php

Plugin::load('MaterialDesignTheme', ['bootstrap' => true, 'routes' => true]);

Enable theme

// src/Controller/AppController.php

public function beforeRender(Event $event)
{
    $this->viewBuilder()->setTheme('MaterialDesignTheme');
}

Enable Form

// src/View/AppView.php

public function initialize()
{
    $this->loadHelper('Form', ['className' => 'MaterialDesignTheme.Form']);
}

Customize Layout

// 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:

  1. src/Template/Plugin/MDB/Element/nav-top.ctp

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request