顯示具有 Yii 標籤的文章。 顯示所有文章
顯示具有 Yii 標籤的文章。 顯示所有文章

2010年4月13日 星期二

Yii: Custom PageSize in CGridView

<?php

// Custom PageSize
$data = $model->search();
$data->pagination->pageSize = 5;

$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'table-grid',
    'dataProvider'=>$data,
    // 'filter'=>$model,
    'columns'=>array(
        'id',
        'userId',
        array(
            'class'=>'CButtonColumn',
        ),
    ),
)); ?>

2010年1月22日 星期五

Yii : How to upload a file using a model

How to upload a file using a model
http://www.yiiframework.com/doc/cookbook/2/


Multi File upload - CFileValidator and CUploadedFile
http://www.yiiframework.com/forum/index.php?/topic/3035-multi-file-upload-cfilevalidator-and-cuploadedfile/

Usefull Yii Extension


Datafilter
This extension can be used to add search and filtration capabilities to data grids.
http://www.yiiframework.com/extension/datafilter/

grbac
This module is for User-Management
http://www.yiiframework.com/extension/grbac/

extendedclientscript
With this extension you can transparently reduce page load times by combining and compressing the used Javascript and CSS files.
http://www.yiiframework.com/extension/extendedclientscript/

euploadify
This extension adds a flash based file-upload with progress-bar and multi-file upload capability.
http://www.yiiframework.com/extension/euploadify/

cfile
This extension offers commonly used functions for filesystem objects (files and directories) manipulation.
http://www.yiiframework.com/extension/cfile/

esanitizer
This extension sanitizes all user input ($_POST, $_GET, $_COOKIE,$_FILES) with html purifier to protect against XSS
http://www.yiiframework.com/extension/esanitizer/

cvsout
http://www.yiiframework.com/extension/csvout/reviews/

printout
http://www.yiiframework.com/extension/printout/

How to add more information to Yii::app()->user

在 Yii 中,一般情況會用
$id=Yii::app()->user->id; // 取得 username

第一次在 view 裡面使用時,覺得很怪異,我要 id 怎麼取到 username (LoginID)...

以下文件說明
1) 如何把 id 取代成 table 的 id 欄位 (sequence id)
2) 如何增加 user 的欄位,如 lastLoginTime

http://www.yiiframework.com/doc/cookbook/6/

2010年1月21日 星期四

Yii extension:從 mwb file 產生 model

mwbmodelcommand  

http://www.yiiframework.com/extension/mwbmodelcommand/

php.ini 需載入 zip extension,不然會出現以下錯誤

Warning: simplexml_load_file(): I/O warning : failed to load external entity "zip://db.mwb#document.mwb.xml" in ...commands\shell\mwbModelCommand.php on line 78