PATH:
home
/
letacommog
/
letaweb
/
protected
/
components
<?php /** * Controller is the customized base controller class. * All controller classes for this application should extend from this base class. */ class PController extends CController { /** * @var string the default layout for the controller view. Defaults to 'column1', * meaning using a single column layout. See 'protected/views/layouts/column1.php'. */ public $layout = 'column4'; /** * @var array context menu items. This property will be assigned to {@link CMenu::items}. */ public $menu = array(); /** * @var array the breadcrumbs of the current page. The value of this property will * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links} * for more details on how to specify this property. */ public $breadcrumbs = array(); public function indsfit() { echo "dfdfdsfds"; parent::init(); $app = Yii::app(); if (isset($_GET['lang'])) { $app->language = $_GET['lang']; $app->session['_lang'] = $app->language; $cookie = new CHttpCookie('lang', $_GET['lang']); $cookie->expire = time() + 60 * 60 * 24 * 180; Yii::app()->request->cookies['lang'] = $cookie; } elseif (isset($app->session['_lang'])) { $app->language = $app->session['_lang']; } else { $lang = substr(Yii::app()->getRequest()->getPreferredLanguage(), 0, 2); if (isset(Yii::app()->request->cookies['lang'])) { $lang = Yii::app()->request->cookies['lang']->value; } $app->language = $lang; $app->session['_lang'] = $lang; } //Yii::import('site_app.languages.'.$app->language, true); } public function t($key) { $app = Yii::app(); $key = trim($key); if (defined($key)) { echo constant($key); } else { echo $key; } } public function term($key) { $app = Yii::app(); $lang = Yii::app()->language; if (defined($key)) { return constant($key); } return $key; } public function ajaxSuccess($data) { $rs = array('success' => true, 'data' => $data); echo json_encode($rs); } public function ajaxError($msg = '') { $rs = array('success' => false, 'type' => 1, 'message' => $msg); echo json_encode($rs); } public function ajaxLoginRequired($msg = '') { $rs = array('success' => false, 'type' => 2, 'message' => $msg); echo json_encode($rs); } }
[+]
..
[-] DbMigration.php
[edit]
[-] PController.php
[edit]