随笔分类 -  Yii Framework

Yii2 widgets [mztest/yii2-widget-file-upload]
摘要:Enjoy it. A widget for uploading files to your server. Github , Packagist Screenshots 阅读全文

posted @ 2017-02-28 16:51 技术员 阅读(219) 评论(0) 推荐(0)

Yii2 Working with Relational Data at ActiveDataProvider
摘要:Yii2 Working with Relational Data at ActiveDataProvidernamespace common\models;use Yii;use yii\base\Model;use yii\data\ActiveDataProvider;use common\m... 阅读全文

posted @ 2015-03-09 09:58 技术员 阅读(838) 评论(2) 推荐(1)

多个Yii项目之间共享CMemCache
摘要:红色部分为重要留意部分!// application components 'components'=>array( 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, 'stateKeyPrefix' => 'KOPUSTATE', 'identityCookie'=>array('domain' => APPLICATION_COOKIE_DO 阅读全文

posted @ 2013-04-03 15:45 技术员 阅读(326) 评论(0) 推荐(0)

多个Yii项目共享cookie登录方式
摘要:多个Yii项目,共享cookie登录方式,修改main.php多个项目:每个项目均有不同的子域名。'components'=>array( 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, 'stateKeyPrefix' => 'Enter your state key prefix here', ), 'session'=>array( 'cookiePa 阅读全文

posted @ 2013-03-08 13:54 技术员 阅读(1560) 评论(0) 推荐(0)

Yii add 'engine and charset' at creating new table.
摘要:$this->createTable('{{test}}', array( 'id' => 'pk', ), 'ENGINE=InnoDB DEFAULT CHARSET=utf8'); 阅读全文

posted @ 2012-12-05 17:04 技术员 阅读(145) 评论(0) 推荐(0)

Stupid IE process 'application/json' content-type.
摘要:Let's see the snippets first.jQuery$.ajax({ 'url': 'http://aptana-local/testobject/test1.php', 'dataType': 'json', "success": function(data){ alert(data); console.log(data); console.log(typeof data); }});PHP (test1.php)echo $this->_sendResponse($arr); 阅读全文

posted @ 2012-11-22 16:07 技术员 阅读(912) 评论(0) 推荐(0)

Change error CSS Class of text Filed.
摘要:Actaully we use this creating a text filed.$form->textField(CModel $model, string $attribute, array $htmlOptions=array ( ));Form reference.Generates a text field input for a model attribute. If the attribute has input error, the input field's CSS class will be appended witherrorCss. The defau 阅读全文

posted @ 2012-11-10 15:17 技术员 阅读(170) 评论(0) 推荐(0)

How to use your own jQuery library in YII?
摘要:How to use your own jQuery library in YII?We can use the following line to load Yii jQuery, but it's not always latest version of jQuery. Sometime we need to customize it.Yii::app()->clientScript->registerCoreScript('jquery');So add the following to config/main.php 'components& 阅读全文

posted @ 2012-11-10 15:01 技术员 阅读(215) 评论(0) 推荐(0)

Yii framwork - Url Manager
摘要:Url Manager A.User-friendly URLSarray( ...... 'components'=>array( ...... 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=> false, 'urlFormat'=> false, 'rules'=>array( '<controller:\w+>/<id:\d+>' 阅读全文

posted @ 2012-10-15 17:04 技术员 阅读(247) 评论(0) 推荐(0)

Yii migrations
摘要:At the beginning, why we need migration?In a long time, PHP has no way to currently deploy a project at many server at same time with the exactly same database schema.Most time we have to dump database and import them to some othere server. If someone changed the database schema, we have to apply th 阅读全文

posted @ 2012-10-15 15:29 技术员 阅读(712) 评论(0) 推荐(0)

导航