attribute(ServiceId, name, description, Image) を持つ Service という名前の単純なモデルがあり、CListview を使用してビューにすべてのレコードを表示したいのですが、すべてではなく名前と説明の属性のみを表示したいと考えています。
モデルを表示することはできますが、id および image 属性を非表示にする解決策が見つかりません。
誰でも解決策を教えてもらえますか?
前もって感謝します。
これが私のコードです:
コントローラー:
public function actionIndex()
{
$model = new Service();
$this->render('index',array(
'model'=>$model,
));
}
と私のビュー:
<h1>Services</h1>
<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$model->search(),
'itemView'=>'_view',
));
?>