上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: 1、Yii中的widget可以使用一完全独立的mvc就算是在layout中还是可以获取到数据库的数据2、方法1、/app/View/Elements/widget.ctp$data = $this->requestAction('/controller/action/param1/etc');方法2、 function beforeFilter() { parent::beforeFilter(); $this->set( 'cool_variable', $this->YourMethodOrComponent->action($par 阅读全文
posted @ 2013-05-15 10:39 linksgo2011 阅读(114) 评论(0) 推荐(0) 编辑
摘要: <?php $item = array(); $item['/DashBoardCO'] = array( 'parent' => '', 'text' => '控制面板', 'url' => '/DashBoardCO' ); $item['/dashboardco/merchants'] = array( 'parent' => '/DashBoardCO', 'text' => 阅读全文
posted @ 2013-05-14 11:18 linksgo2011 阅读(168) 评论(0) 推荐(0) 编辑
摘要: ignore_user_abort();//关掉浏览器,PHP脚本也可以继续执行. set_time_limit(0);// 通过set_time_limit(0)可以让程序无限制的执行下去 $interval=60*30;// 每隔半小时运行 do{ //这里是你要执行的代码 sleep($interval);// 等待5分钟 }while(true);除了使用任务计划的方式,还可以使用网上的一些采集脚本来刷、上面这种方式也是一个很好的方式 阅读全文
posted @ 2013-05-08 15:46 linksgo2011 阅读(153) 评论(0) 推荐(0) 编辑
摘要: $comments = $this->requestAction('/comments/latest');foreach ($comments as $comment) { echo $comment['Comment']['title'];}echo $this->requestAction( array('controller' => 'articles', 'action' => 'featured'), array('return')) 阅读全文
posted @ 2013-05-07 11:40 linksgo2011 阅读(110) 评论(0) 推荐(0) 编辑
摘要: $host = APP_DEV ? 'ecode.com' : 'ecode.yinuoinfo.com'; $uri = 'http://' . $host . '/ApiJsonTicket/sendticket'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ... 阅读全文
posted @ 2013-05-06 14:46 linksgo2011 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1、如果封装js对象最常见的就是使用构造方法,记住一句话js中一切都是对象和一切都是引用即可 function Girl(name,age){ var love = '' ; 这样对象内部的局部变量,只有这个作用域被激活了后才能使用这个变量 this.name = name; 这个是成员变量 this.age = age; //构造 this.say = function(){ return love; //实现js的封装,同时这个对象也是一个闭包,这个方法用于似有变量的读取操作 } //还要记住一句话,方法也是变量和变量的操作一致 this.movelove ... 阅读全文
posted @ 2013-05-05 19:41 linksgo2011 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 配置文件如return array('''key'=>"value");读取就和简单直接file_get_content()读取出来回写,比较麻烦,可以使用下面的方法: $page_config['widgets']['_widget_284']['options'] = array_merge($page_config['widgets']['_widget_284']['options'], $options); $page_config 阅读全文
posted @ 2013-05-02 11:40 linksgo2011 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 原理:获取数据库资源句柄 -》curd 操作-》使用 rallback或者submit 提交或者回滚即可例子:$dataSource = $this->getDataSource();$dataSource->begin();// Perform some tasksif (/*all's well*/) { $dataSource->commit();} else { $dataSource->rollback();} 阅读全文
posted @ 2013-04-28 15:11 linksgo2011 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 原理就是使用数据库的方法处理出来一个查询结果,然后使用一个别名、//比如select contanct(a,b) as ca , b 就是一个普通的属性,c可以理解为public $virtualFields = array( 'name' => 'CONCAT(User.first_name, " ", User.last_name)');配置的方法很简单,如上就是、 阅读全文
posted @ 2013-04-28 15:06 linksgo2011 阅读(136) 评论(0) 推荐(0) 编辑
摘要: {php}$var =$this->get_template_vars('var');var_dump($var);{/php}打印出数组当中的数据 阅读全文
posted @ 2013-04-24 18:44 linksgo2011 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页