_view.php 847 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * This is the template for generating the partial view for rendering a single model.
  4. * The following variables are available in this template:
  5. * - $ID: the primary key name
  6. * - $modelClass: the model class name
  7. * - $columns: a list of column schema objects
  8. */
  9. ?>
  10. <div class="view">
  11. <?php
  12. echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$ID}')); ?>:</b>\n";
  13. echo "\t<?php echo CHtml::link(CHtml::encode(\$data->{$ID}), array('view', 'id'=>\$data->{$ID})); ?>\n\t<br />\n\n";
  14. $count=0;
  15. foreach($columns as $column)
  16. {
  17. if($column->isPrimaryKey)
  18. continue;
  19. if(++$count==7)
  20. echo "\t<?php /*\n";
  21. echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$column->name}')); ?>:</b>\n";
  22. echo "\t<?php echo CHtml::encode(\$data->{$column->name}); ?>\n\t<br />\n\n";
  23. }
  24. if($count>=7)
  25. echo "\t*/ ?>\n";
  26. ?>
  27. </div>