Yii

Yii PHP 框架分析 (一)

為{幸葍}努か 提交于 2020-01-19 02:13:48
Yii PHP 框架分析 (一) 作者:wdy http://hi.baidu.com/delphiss/blog/item/f7da86d787adb72506088b4b.html 基于yii1.0.8的代码分析的。用了一个下午整理的,流水账,感兴趣的凑合着先看,国庆期间推出个整理修改版,然后再完成后两个部分(MVC和Yii的整体结构分析)。 1. 启动 网站的唯一入口程序 index.php : $yii=dirname(__FILE__).'/../framework/yii.php'; $config=dirname(__FILE__).'/protected/config/main.php'; // remove the following line when in production mode defined('YII_DEBUG') or define('YII_DEBUG',true); require_once($yii); Yii::createWebApplication($config)->run(); 上面的require_once($yii) 引用出了后面要用到的全局类Yii,Yii类是YiiBase类的完全继承: class Yii extends YiiBase { } 系统的全局访问都是通过Yii类(即YiiBase类)来实现的

yii执行流程

戏子无情 提交于 2020-01-19 02:13:11
yii执行流程 原文: http://www.cnblogs.com/bluecobra/archive/2011/11/30/2269207.html 一 目录文件 |-framework 框架核心库 |--base 底层类库文件夹,包含CApplication(应用类,负责全局的用户请求处理,它管理的应用组件集,将提供特定功能给整个应用程序),CComponent(组件类,该文件包含了基于组件和事件驱动编程的基础类,从版本1.1.0开始,一个行为的属性(或者它的公共成员变量或它通过getter和/或setter方法??定义的属性)可以通过组件的访问来调用),CBehavior(行为类,主要负责声明事件和相应事件处理程序的方法、将对象的行为附加到组件等等),CModel(模型类,为所有的数据模型提供的基类),CModule(是模块和应用程序的基类,主要负责应用组件和子模块)等等 |--caching 所有缓存方法,其中包含了Memcache缓存,APC缓存,数据缓存,CDummyCache虚拟缓存,CEAcceleratorCache缓存等等各种缓存方法 |--cli YII项目生成脚本 |--collections 用php语言构造传统OO语言的数据存储单元。如:队列,栈,哈希表等等 |--console YII控制台 |--db 数据库操作类 |--gii YII 代码生成器

Toggle Column visibility in Yii Framework

时间秒杀一切 提交于 2020-01-17 11:16:29
问题 I'm using the CGridView widget to get data (39 columns) from a model, but the Table its way to large, i need to add a button to toggle some columns visible or not (lets say 20), maybe with jQuery, but i have no idea where to start, any ideas would be appreciated! <?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'contacts-grid', 'itemsCssClass' => 'table table-striped table-bordered table-hover table-checkable table-responsive ', 'dataProvider'=>$model->search(), 'filter'=>$model

Yii: how to use actionupload() in actioncreate()

梦想的初衷 提交于 2020-01-17 06:07:10
问题 i am yiibie and i am trying to use the uploadaction() function in the createaction() function so that i can upload videos and can also manage videos. I am using multiuploadfile extension. I dont know how to merge the upload function into create function. This is the code of my VideoController which has both the actionUpload() and actioncreate() function. <?php class VideoController extends RController { /** * @var string the default layout for the views. Defaults to '//layouts/column2',

How to pass the data into the text-fields

 ̄綄美尐妖づ 提交于 2020-01-16 19:05:48
问题 I am trying to write the code for parsing the uploaded .csv file. I have written the following code. The controller generates the rows of the CSV file in the form of arrays which I have also tried to print with print_r($buffer); statement and I get the expected output. Though the strings can be printed using echo $string; , but I am not able to pass them to the text-fields for editing before saving to the database. SiteController public function actionImport() { $buffer[] = array(); if(isset(

Swift_TransportExceptionConnection could not be established with host smtp.gmail.com

岁酱吖の 提交于 2020-01-16 14:48:22
问题 Trying to send email in php. transport: smtp host: smtp.gmail.com username: example@example.com password: password port: 587 encryption: ssl Options already tried: Tried all combinations of port (22, 465, 587) and encryption (No encryption, SSL, TLS) Allow access to less secure apps is on and two ways authentication is off. checked host details: and tried with above host name and ips. Tested mailtrap.io and its working fine! (receiving email in mailtrap inbox, so no issue in code ) I'm using

Swift_TransportExceptionConnection could not be established with host smtp.gmail.com

梦想与她 提交于 2020-01-16 14:48:13
问题 Trying to send email in php. transport: smtp host: smtp.gmail.com username: example@example.com password: password port: 587 encryption: ssl Options already tried: Tried all combinations of port (22, 465, 587) and encryption (No encryption, SSL, TLS) Allow access to less secure apps is on and two ways authentication is off. checked host details: and tried with above host name and ips. Tested mailtrap.io and its working fine! (receiving email in mailtrap inbox, so no issue in code ) I'm using

Swift_TransportExceptionConnection could not be established with host smtp.gmail.com

断了今生、忘了曾经 提交于 2020-01-16 14:48:03
问题 Trying to send email in php. transport: smtp host: smtp.gmail.com username: example@example.com password: password port: 587 encryption: ssl Options already tried: Tried all combinations of port (22, 465, 587) and encryption (No encryption, SSL, TLS) Allow access to less secure apps is on and two ways authentication is off. checked host details: and tried with above host name and ips. Tested mailtrap.io and its working fine! (receiving email in mailtrap inbox, so no issue in code ) I'm using

Hash password compatibility between Yii ( Php Crypt ) and Laravel Sentinel

。_饼干妹妹 提交于 2020-01-16 11:59:20
问题 I'm building a laravel app using Sentinel, based in an old system code in Yii. Purpose is be able to login in new system with old users / old db. I first has to resolved model issue: Custom Model and fields with Sentinel / Laravel Now, it is ok. I have a last issue, it seems to be hashing password from different ways. When I check the hash method in Yii, I can find that it use Blowfish algorithm: /** * CPasswordHelper provides a simple API for secure password hashing and verification. * *

Hash password compatibility between Yii ( Php Crypt ) and Laravel Sentinel

旧巷老猫 提交于 2020-01-16 11:59:07
问题 I'm building a laravel app using Sentinel, based in an old system code in Yii. Purpose is be able to login in new system with old users / old db. I first has to resolved model issue: Custom Model and fields with Sentinel / Laravel Now, it is ok. I have a last issue, it seems to be hashing password from different ways. When I check the hash method in Yii, I can find that it use Blowfish algorithm: /** * CPasswordHelper provides a simple API for secure password hashing and verification. * *