摘要:Enjoy it. A widget for uploading files to your server. Github , Packagist Screenshots
阅读全文
摘要:Yii2 Working with Relational Data at ActiveDataProvidernamespace common\models;use Yii;use yii\base\Model;use yii\data\ActiveDataProvider;use common\m...
阅读全文
摘要:红色部分为重要留意部分!// application components 'components'=>array( 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, 'stateKeyPrefix' => 'KOPUSTATE', 'identityCookie'=>array('domain' => APPLICATION_COOKIE_DO
阅读全文
摘要:多个Yii项目,共享cookie登录方式,修改main.php多个项目:每个项目均有不同的子域名。'components'=>array( 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, 'stateKeyPrefix' => 'Enter your state key prefix here', ), 'session'=>array( 'cookiePa
阅读全文
摘要:$this->createTable('{{test}}', array( 'id' => 'pk', ), 'ENGINE=InnoDB DEFAULT CHARSET=utf8');
阅读全文
摘要: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);
阅读全文
摘要: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
阅读全文
摘要: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&
阅读全文
摘要:Url Manager A.User-friendly URLSarray( ...... 'components'=>array( ...... 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=> false, 'urlFormat'=> false, 'rules'=>array( '<controller:\w+>/<id:\d+>'
阅读全文
摘要: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
阅读全文