This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1、You can get the last inserted ID like this: | |
| Yii::app()->db->getLastInsertId(); | |
| 2、If $model->id wouldn't work then use Yii::app()->db->getLastInsertId() or getPrimaryKey() | |
| 3、If your goal is to get the id that was assigned to the model that you just saved, | |
| then after you do $model->save(), simply do $model->id to get it back. | |
| 4、 | |
| you can also get the last inserted id of another model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $dataProvider = new ActiveDataProvider([ | |
| 'query' => $query, | |
| 'pagination'=>[ | |
| 'pageSize'=>10, | |
| ] | |
| ]) | |
| $query -> andWhere('url is not null'); | |
| $query -> andWhere(['parent_id'=>123]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php $model->icon = $iconer;?>//此处是将$iconer变量的值传到icon成员变量里,在item回调函数里,用来判断是否是默认值(判断$checked是否是true) | |
| <label class = 'control-label'><?=Yii::t('app', 'Icon');?>: </label><?= MyHtml::activeRadioList($model, 'icon', $i_data,['class'=>'radio_icon', 'encode' => 0, | |
| 'item' => function ($index, $label, $name, $checked, $value){ | |
| if ($checked) {//此处对应于第一行 | |
| return Html::radio($name, ['checked'=>true],['value'=>$value,'label'=>$label]); | |
| } | |
| return Html::radio($name, $checked,['value'=>$value,'label'=>$label]); | |
| }])?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://www.cnblogs.com/rainman/p/3837671.html | |
| http://www.cnblogs.com/leezhxing/p/4472155.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#container_chart').highcharts({ | |
| chart: { | |
| type: type, | |
| zoomType: 'x' | |
| }, | |
| title: { | |
| text: 'data_title' | |
| }, | |
| xAxis: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://edbiji.com/ | |
| http://www.meadow.se/wordpress/refreshing-data-in-jquery-datatables/ | |
| https://segmentfault.com/a/1190000000687844 | |
| http://www.kaufmann.no/roland/dvorak/winxp.html | |
| http://0x1.im/blog/php/php-cs-fixer.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * recursive function in order to convert a multiple dimensions array to a single dimension array | |
| * @param array $array | |
| * @param array $res | |
| * @return $res | |
| * @auther pzzrudlf <pzzrudlf@gmail.com> | |
| */ | |
| public function convertToSingleArray($array, &$res=[]) | |
| { | |
| foreach ($array as $key => $value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table id="__01" class="table-responsive" border="0" cellpadding="0" cellspacing="0"> | |
| <?php | |
| $i = 0; | |
| $content = ''; | |
| foreach ($indexdata as $key => $value) { | |
| if ($i%2 == 0){//每7列换一行,配合下面的判断使用 | |
| $content .= '<tr>'; | |
| } | |
| $id = $value['id']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table id="__01" class="table-responsive" border="0" cellpadding="0" cellspacing="0"> | |
| <?php | |
| $i = 0; | |
| $content = ''; | |
| foreach ($indexdata as $key => $value) { | |
| if ($i%2 == 0){//每7列换一行,配合下面的判断使用 | |
| $content .= '<tr>'; | |
| } | |
| $id = $value['id']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| change the declaration way of the specific function that you defined | |
| <script> | |
| window.onload = function(){ | |
| //there may occur some errors. 'referenceError:exeSelect() is not defined' | |
| function exeSelect(param) | |
| { | |
| console.log(param); | |
| } |