title: Change display html table in view on Yii Framework
body: <p>I have made a module for financial management using Yii php framework and installed the model, controller, CRUD , and views through Gii. Now I want to display the contents created for each financial movement in a table , one movement per row, inside the view movements page - such as in the admin.php (the manage control), but without the ability to update them.</p>
  
  <p>I'm very new to Yii and, even though I tried very hard, Yii seems to be too obscure for me to achieve anything. How can I make my movement/views/view.php display a HTML table with the all the entries from my movement table?</p>
  
  <p>--UPDATE:</p>
  
  <p>Here is the code form _view.php</p>
  
  <pre><code>    &lt;?php
  
  /* @var $this MovementController */
  /* @var $data Financialmovement */
  
  $due = gmdate( 'd/m/Y', $data-&gt;due_date );
  
  if ( $data-&gt;pay_date != 0 ) {
      $pay = gmdate( 'd/m/Y', $data-&gt;pay_date );
  } else {
      $pay = 'Indisponível';
  }
  switch ( $data-&gt;category ):
      case ('trn'):
          $category = "Transporte";
          break;
      case ('fin'):
          $category = "Financeiro";
          break;
      default :
          $category = 'Erro! Valor nulo.';
  endswitch;
  
  if ( $data-&gt;condition = 1 ) {
      $condition = 'Concluída';
  } else {
      $condition = 'Aberta';
  }
  
  if ( $data-&gt;movement_type = 1 ) {
      $type = 'Saída';
  } else {
      $type = 'Entrada';
  }
  
  
  $value = $data-&gt;value;
  $patern = '/\./';
  $replacement = ',';
  $value = preg_replace( $patern, $replacement, $value );
  
  $coin = $data-&gt;coin_type;
  $patern = '/s/';
  $replacement = '$';
  $coin = preg_replace( $patern, $replacement, $coin );
  
  ?&gt;
  
  &lt;tr class="wide form"&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'id' ); ?&gt;:
          &lt;?php echo CHtml::link( ( $data-&gt;id ), array( 'view', 'id' =&gt; $data-&gt;id ) ); ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'category' ); ?&gt;:
          &lt;?php echo $category; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'value' ); ?&gt;:
          &lt;?php echo '&lt;span class="capital"&gt;' . $coin . "&lt;/span&gt; " . $value; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'due_date' ); ?&gt;:
          &lt;?php echo $due; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'pay_date' ); ?&gt;:
          &lt;?php echo $pay; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'description' ); ?&gt;:
          &lt;?php echo $data-&gt;description; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'condition' ); ?&gt;:
          &lt;?php echo $condition; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'movement_type' ); ?&gt;:
          &lt;?php echo $type; ?&gt;
  
      &lt;/td&gt;
      &lt;td &gt;
          &lt;?php echo $data-&gt;getAttributeLabel( 'observation' ); ?&gt;:
          &lt;?php echo $data-&gt;observation; ?&gt;
  
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Here is the code for view.php:</p>
  
  <pre><code>    &lt;?php
  
  /* @var $this MovementController */
  /* @var $model Financialmovement */
  
  $this-&gt;breadcrumbs = array(
      'Financial Movements' =&gt; array( 'index' ),
      $model-&gt;id,
  );
  
  $this-&gt;menu = array(
      array( 'label' =&gt; 'List Financial Movement', 'url' =&gt; array( 'index' ) ),
      array( 'label' =&gt; 'Create Financial Movement', 'url' =&gt; array( 'create' ) ),
      array( 'label' =&gt; 'Update Financial Movement', 'url' =&gt; array( 'update', 'id' =&gt; $model-&gt;id ) ),
      array( 'label' =&gt; 'Delete Financial Movement', 'url' =&gt; '#', 'linkOptions' =&gt; array( 'submit' =&gt; array( 'delete', 'id' =&gt; $model-&gt;id ), 'confirm' =&gt; 'Are you sure you want to delete this item?' ) ),
      array( 'label' =&gt; 'Manage Financial Movement', 'url' =&gt; array( 'admin' ) ),
  );
  
  ?&gt;
  
  &lt;h1&gt;View Financial Movement #&lt;?php echo $model-&gt;id; ?&gt;&lt;/h1&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;Id&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php
  
      $dataProvider = new CActiveDataProvider( 'Financialmovement' );
  
      $this-&gt;widget( 'zii.widgets.CListView', array(
          'dataProvider' =&gt; $dataProvider,
          'itemView' =&gt; '_view', // refers to the partial view named '_view'
          'sortableAttributes' =&gt; array(
              'id',
              'due_date',
              'pay_date',
              'category',
          ),
      ) );
  
      ?&gt;
  &lt;/table&gt;
  </code></pre>