flysolo
- flysolo 回答了问题 限制图片访问权限如何设置?
把图片上传到不是公开的目录然后用PHP动态输出
$imgpath = "图片路径"
$info=getimagesize($imgpath);
$imgdata=fread(fopen($imgpath,'rb'),filesize($imgpath));
header("content-type:".$info['mime']);
echo $imgdata; - flysolo 2014-11-14 已签到连续签到5天,获得了20个金钱
- flysolo 回答了问题 yii中layout传递数据
模板里附值
$this->params['xxx'] = '2323';
layout布局模板里调用
$this->params['xxx'];
- flysolo 2014-11-13 已签到连续签到4天,获得了20个金钱
- flysolo 回答了问题 form-group
<?= $form->field($model, 'name',['class'=>''])->textInput(['maxlength' => 50]) ?>
- flysolo 2014-11-12 已签到连续签到3天,获得了15个金钱
[ 'attribute' => 'comment', 'filter' => false, 'format' => 'raw', 'value' => function ($data) { return str_replace("\n", "<br />", $data->comment); // return Html::a('查看', ['view', 'id' => $data->id], ['class' => 'viewcomment', 'data-pjax' => '0']); }, ],
http://www.yiichina.com/api/2.0/yii-grid-datacolumn#$format-detail
'format' => 'raw',
- flysolo 回答了问题 gii生成字段加链接,怎么显示文本啊
[ 'attribute' => 'comment', 'filter' => false, 'format' => 'raw', 'value' => function ($data) { return str_replace("\n", "<br />", $data->comment); // return Html::a('查看', ['view', 'id' => $data->id], ['class' => 'viewcomment', 'data-pjax' => '0']); }, ],
http://www.yiichina.com/api/2.0/yii-grid-datacolumn#$format-detail
- flysolo 回答了问题 GridView 显示字段多个值中的一个
'columns' => [ ... [ 'attribute' => 'country_id', 'value'=>function($data) { return $data->cuntry_id . $data->xxxx }
], ],
- flysolo 2014-11-11 已签到连续签到2天,获得了10个金钱