Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom CListView in Yii framework
    primarykey
    data
    text
    <p>I wanted to modify the default list view provided by the Yii framework. The current view display everything as a row <img src="https://i.stack.imgur.com/pPlKo.png" alt="enter image description here">. What I want is to display the information in following format<img src="https://i.stack.imgur.com/cAo3H.png" alt="enter image description here">. Could you suggest me how can I extend this widget and create my own view. I have attached both needed as a image. I am new to Yii so all help would be really appriciable. If there is already any widget in this format I would be so happy.</p> <p>Content for my view File would be </p> <pre><code> &lt;?php /* @var $this LeosafealertController */ /* @var $data Leosafealert */ ?&gt; &lt;div class="view"&gt; &lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('id')); ?&gt;:&lt;/b&gt; &lt;?php echo CHtml::link(CHtml::encode($data-&gt;id), array('view', 'id'=&gt;$data-&gt;id)); ?&gt; &lt;br/&gt; &lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('date')); ?&gt;:&lt;/b&gt; &lt;?php echo CHtml::encode($data-&gt;date); ?&gt; &lt;br/&gt; &lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('description')); ?&gt;:&lt;/b&gt; &lt;?php echo CHtml::encode($data-&gt;description); ?&gt; &lt;br/&gt; &lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('photo')); ?&gt;:&lt;/b&gt; &lt;?php echo CHtml::image($data-&gt;getImageURL().$data-&gt;photo,$data-&gt;photo); ?&gt; &lt;/br&gt; &lt;b&gt;&lt;?php echo CHtml::encode($data-&gt;getAttributeLabel('link')); ?&gt;:&lt;/b&gt; &lt;?php echo CHtml::link(CHtml::encode("click here"), $data-&gt;getFileURL().$data-&gt;link,array('target'=&gt;'_blank')); ?&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload