vladkrasovsky
12/9/2016 - 11:32 AM

Yii2 hints

Yii2 hints

<?php
/**
 * CACHE
 */
// set cache
Yii::$app->cache->set('menu', $this->menuHtml, 60);
// get cache
$menu = Yii::$app->cache->get('menu');

/**
 * SESSION
 */
$session = Yii::$app->session;
$session->open();
// set flash
Yii::$app->session->setFlash('success', "Товар {$model->name} добавлен");
// has flash
Yii::$app->session->hasFlash('success');
// get flash
Yii::$app->session->getFlash('success');

/**
 * EXTENSIONS
 */
// CKEditor https://github.com/MihailDev/yii2-ckeditor
// ElFinder https://github.com/MihailDev/yii2-elfinder
// Images   https://github.com/CostaRico/yii2-images