SemanticUI plugin for CakePHP
This is Semantic UI plugin for CakePhp, it contain Theme for Bake, modified component and Helper., (*1)
Installation
Install using composer, (*2)
composer require kadekjayak/semantic-ui
or Download and extract it into plugin directory on cakephp., (*3)
after that you need to load the plugin manually by adding it into Bootstrap.php, (*4)
Plugin::load('SemanticUI', ['bootstrap' => false, 'routes' => true]);
Requirements
Example
Using Theme for Bake
you can bake with Semantic UI theme by using --theme
options, you can use the command below on terminal, (*5)
/bin/cake bake template all --theme SemanticUI
and use the layout that included from plugin, for example change on your src/Controller/AppController.php
. (actualy i didn't know if it's the correct way), (*6)
public function beforeRender(Event $event)
{
$this->viewBuilder()->layout('SemanticUI.semantic');
if (!array_key_exists('_serialize', $this->viewVars) &&
in_array($this->response->type(), ['application/json', 'application/xml'])
) {
$this->set('_serialize', true);
}
}
to get the Input form Styled you should use Form Helper on this plugin, you can use Form helper on this plugin by passing className
options when loading FormHelper
on your src/View/AppView.php
, (*7)
public function initialize()
{
$this->loadHelper('Form', ['className' => 'SemanticUI.SemanticForm']);
$this->loadHelper('Paginator', ['className' => 'SemanticUI.SemanticPaginator']);
$this->loadHelper('Html', ['className' => 'SemanticUI.SemanticHtml']);
}
Notes
For more info about Semantic UI visit their official website on : http://semantic-ui.com/, (*8)