摘要:
创建应用,假设yii的核心文件夹framework是放在/media/MyDocuments/xampp/htdocs/myyiicd /media/MyDocuments/xampp/htdocs/myyiiphp framework/yiic.php webapp /media/MyDocuments/xampp/htdocs/myyii 阅读全文
posted @ 2010-04-21 11:54
DavidHHuan
阅读(431)
评论(0)
推荐(0)
摘要:
<?php return array( 'class'=>'CUrlManager', 'urlFormat'=>'path', 'urlSuffix'=>'.html', 'showScriptName'=>false, 'caseSensitive'=>false,//it makes route case-insensitive. 'rules'=>... 阅读全文
posted @ 2010-04-21 11:53
DavidHHuan
阅读(622)
评论(0)
推荐(0)
摘要:
mysql:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--'db'=array('connectionString'='mysql:host=localhost;dbname=tsmp','username'='root','password'='1','charset'='utf8', 'tablePrefix'='tbl_',//'schemaCachingDuration'=3600,//如果在main.php里面设置了c 阅读全文
posted @ 2010-04-21 11:53
DavidHHuan
阅读(796)
评论(0)
推荐(0)
摘要:
public function filters(){ return array( ’postOnly + edit, create’, array( ’application.filters.PerformanceFilter - edit, create’, ’unit’=>’second’, ... 阅读全文
posted @ 2010-04-21 11:52
DavidHHuan
阅读(436)
评论(0)
推荐(0)
摘要:
创建[代码]调用[代码] 阅读全文
posted @ 2010-04-21 11:52
DavidHHuan
阅读(841)
评论(10)
推荐(1)
摘要:
main.php文件'modules' => array( 'admin' => require(dirname(__FILE__).DIRECTORY_SEPARATOR.'backend.php') )backend.php文件<?phpreturn array( //'sizePerPage' => 10, 'defaultController'=>'user'... 阅读全文
posted @ 2010-04-21 11:52
DavidHHuan
阅读(819)
评论(0)
推荐(0)
摘要:
class MyWidget extends CWidget{public function init(){// this method is called by CController::beginWidget()}public function run(){// this method is called by CController::endWidget()}}通常,widget的视图是是放... 阅读全文
posted @ 2010-04-21 11:51
DavidHHuan
阅读(598)
评论(0)
推荐(0)
摘要:
$this->widget('CMaskedTextField',array('mask'=>'99/99/9999')); 阅读全文
posted @ 2010-04-21 11:51
DavidHHuan
阅读(483)
评论(0)
推荐(0)
摘要:
Ajax请求页面块的时候,是不希望加载layout的,这时候怎么向页面块传递参数呢?可以使用renderPartial()来代替render() 阅读全文
posted @ 2010-04-21 11:51
DavidHHuan
阅读(655)
评论(0)
推荐(0)
摘要:
system: Yii framework directoryapplication: application's base directorywebroot: the directory containing the entry script fileext: directory of extensions 阅读全文
posted @ 2010-04-21 11:50
DavidHHuan
阅读(342)
评论(0)
推荐(0)
摘要:
以on开关定义方法,如要clicked事件,public function onClicked($event){$this->raiseEvent('onClicked', $event);}调用的时候$component->onClicked=$callback;如果$callback是一个全局对象里面的方法,要用以下array($object, 'methodName')方法应该定... 阅读全文
posted @ 2010-04-21 11:50
DavidHHuan
阅读(415)
评论(0)
推荐(0)
摘要:
public function ValidatorName($attribute,$params) f ... G 阅读全文
posted @ 2010-04-21 11:49
DavidHHuan
阅读(289)
评论(0)
推荐(0)
摘要:
例如,要存储timestamp的值是用MySQL now()函数,这时候可以这样,$post = new Post;$post->createTime=new CdbExpression('NOW()');//$post->createTime='NOW()';will not work because 'NOW()' will be treated as a string$post-... 阅读全文
posted @ 2010-04-21 11:49
DavidHHuan
阅读(671)
评论(0)
推荐(0)
摘要:
覆盖tableName()方法 阅读全文
posted @ 2010-04-21 11:48
DavidHHuan
阅读(267)
评论(0)
推荐(0)
摘要:
直接在views里面使用$this->method(),如controller里面:Class PostController extends Ccontroller{Puvlic function actionList(){....}Public function getTitle(){return 'test title';}}views的list.php<?php echo $th... 阅读全文
posted @ 2010-04-21 11:48
DavidHHuan
阅读(510)
评论(0)
推荐(0)

浙公网安备 33010602011771号