2016年4月7日

页面静态化

摘要: 控制器: //页面静态化(缓存) public function behaviors() { return [ [ 'class' => 'yii\filters\PageCache', 'only' => ['list'], 'duration' => 60, 'variations' => [ 阅读全文

posted @ 2016-04-07 19:04 *孤独的夜行者* 阅读(153) 评论(0) 推荐(0)

yii2 生成PDF格式的文件

摘要: 1 .先把mpdf-development.zip解压的类文件夹放到vendor目录里面,重命名为mpdf 2 .在vendor/composer/autoload_namespaces.php里面添加 'mPDF' => array($vendorDir . '/mpdf'),(看看是几层目录) 阅读全文

posted @ 2016-04-07 19:03 *孤独的夜行者* 阅读(1845) 评论(0) 推荐(0)

Apache 的ab测试

摘要: Apache 的ab测试 A/B测试 A/B测试是一种新兴的网页优化方法,可以用于增加转化率注册率等网页指标。。 A/B测试的目的在于通过科学的实验设计、采样样本代表性、流量分割与小流量测试等方式来获得具有代表性的实验结论,并确信该结论在推广到全部流量可信。 如何使用Apache的ab工具进行网站性 阅读全文

posted @ 2016-04-07 18:55 *孤独的夜行者* 阅读(242) 评论(0) 推荐(0)

简陋的自动保存

摘要: yii2 自动保存 控制器 <?php namespace frontend\controllers; use Yii; class SaveController extends \yii\web\Controller { public $enableCsrfValidation = false; 阅读全文

posted @ 2016-04-07 18:54 *孤独的夜行者* 阅读(176) 评论(0) 推荐(0)

发送邮箱

摘要: yii2 发送邮箱 1.在qq邮箱中 设置--账户--POP3/SMTP服务 把它开启,需要发送短信,会给你一个验证码,这个验证码就是密码 2.在main-local.php的components中添加一下代码 'mailer' => [ 'class' => 'yii\swiftmailer\Ma 阅读全文

posted @ 2016-04-07 18:51 *孤独的夜行者* 阅读(227) 评论(0) 推荐(0)

无限级分类

摘要: yii2 递归无限级分类 模型层 <?php namespace frontend\models; use Yii; /** * This is the model class for table "region". * * @property integer $region_id * @prope 阅读全文

posted @ 2016-04-07 18:43 *孤独的夜行者* 阅读(173) 评论(0) 推荐(0)

yii2 单页面增删改

摘要: 视图层<style>#tab tr td{ height:40px; width:100px;}</style><form action="index.php?r=ceshi/index" method='post'><input name="_csrf" type="hidden" id="_cs 阅读全文

posted @ 2016-04-07 14:49 *孤独的夜行者* 阅读(410) 评论(0) 推荐(1)

yii2 数据验证

摘要: 控制器层 <?php namespace frontend\controllers; use Yii; use frontend\models\FormsModel; use yii\web\UploadedFile; class FormsController extends \yii\web\C 阅读全文

posted @ 2016-04-07 14:40 *孤独的夜行者* 阅读(1080) 评论(0) 推荐(0)

sphinx 全配置

摘要: ## 数据源src1 source src1 { ## 说明数据源的类型。数据源的类型可以是:mysql,pgsql,mssql,xmlpipe,odbc,python ## 有人会奇怪,python是一种语言怎么可以成为数据源呢? ## python作为一种语言,可以操作任意其他的数据来源来获取数 阅读全文

posted @ 2016-04-07 14:35 *孤独的夜行者* 阅读(336) 评论(0) 推荐(0)

yii2 sphinx Ajax搜索分页 关键词的缓存

摘要: 控制器层 <?php namespace frontend\controllers; use Yii; use yii\web\Controller; //use frontend\models\Zhan; use yii\data\Pagination; use SphinxClient; use 阅读全文

posted @ 2016-04-07 14:09 *孤独的夜行者* 阅读(705) 评论(0) 推荐(0)

导航