ani
(Aneesh)
October 15, 2012, 11:35am
1
By reading a file, i want to display them in a list or grid view. Yii have any extension for readind a file? and want display the contents of that file in a list or grid view.
antares
(Antares Mips)
October 15, 2012, 12:26pm
2
No. Yii don’t have extension for reading a file.
Maybe you will find something here http://www.yiiframework.com/extensions/
alirz23
(Ali Raza)
October 17, 2012, 6:06am
3
you can accomplish that with few lines of code php have some neat function to read/write files there is one call
edit
here is some code i tested
gistfile1.php
// your controller code
<?php
public function actionIndex()
{
$path = dirname(__FILE__);
$data = file($path."/../data/data.txt"); // you can move all this stuff into a model or use a method
$dataProvider=new CArrayDataProvider($data, array(
'pagination'=>array(
'pageSize'=>10,
This file has been truncated. show original