I am new to yii and installed V1.1.
I installed crud and register some users, but when click on manage user it goes to an error page.
The column must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional.
foreach($this->columns as $column)
401 $column->init();
402 }
403
404 /**
405 * Creates a {@link CDataColumn} based on a shortcut column specification string.
406 * @param string $text the column specification string
407 * @return CDataColumn the column instance
408 */
409 protected function createDataColumn($text)
410 {
411 if(!preg_match('/^([\w\.]+)(<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/sad.gif' class='bbc_emoticon' alt=':(' />\w*))?(<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/sad.gif' class='bbc_emoticon' alt=':(' />.*))?$/',$text,$matches))
412 throw new CException(Yii::t('zii','The column must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional.'));
413 $column=new CDataColumn($this);
414 $column->name=$matches[1];
415 if(isset($matches[3]) && $matches[3]!=='')
416 $column->type=$matches[3];
417 if(isset($matches[5]))
418 $column->header=$matches[5];
419 return $column;
420 }
421
422 /**
423 * Registers necessary client scripts.
424 */
My admin.php Code is:
<?php
/* @var $this UsersController */
/* @var $model Users */
$this->breadcrumbs=array(
'Users'=>array('index'),
'Manage',
);
$this->menu=array(
array('label'=>'List Users', 'url'=>array('index')),
array('label'=>'Create Users', 'url'=>array('create')),
);
Yii::app()->clientScript->registerScript(‘search’, "
$(’.search-button’).click(function(){
$('.search-form').toggle();
return false;
});
$(’.search-form form’).submit(function(){
$('#users-grid').yiiGridView('update', {
data: $(this).serialize()
});
return false;
});
");
?>
<h1>Manage Users</h1>
<p>
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link(‘Advanced Search’,’#’,array(‘class’=>‘search-button’)); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial(’_search’,array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'users-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'username',
'password',
'‘email’',
array(
'class'=>'CButtonColumn',
),
),
)); ?>