Cheat Sheet YII2 Framework

Meta Tag

$this->title = 'Hello View - Demo Meta Tags'; 
$this->registerMetaTag(['name' => 'keywords', 'content' => 'yii, framework, php']); 
$this->registerMetaTag(['name' => 'description', 'content' => 'Belajar yii framework. Dipersembahkan oleh Codepolitan.


Load View

return $this->render(‘greeting’, [‘name’=>$name]);

Prety URL

‘urlManager’ => [
 ‘enablePrettyUrl’ => true,
 ‘showScriptName’ => true,
 ‘enableStrictParsing’ => false,
 ‘rules’ => [
 ],

Map Controller

'controllerMap' => [
        'demo' => 'app\controllers\HelloController'
    ],

Redirect

return $this->redirect('/url');

Enable Rewrite Apache

https://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache
a2enmod rewrite

CKEDITOR YII

http://www.yiiframework.com/extension/yii2-ckeditor-widget/#hh0
https://stackoverflow.com/questions/30979305/how-to-create-ckeditor-in-yii2
composer require 2amigos/yii2-ckeditor-widget












Leave a Reply

Your email address will not be published. Required fields are marked *