_view.php 920 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * The following variables are available in this template:
  4. * - $this: the CrudCode object
  5. */
  6. ?>
  7. <?php echo "<?php\n"; ?>
  8. /* @var $this <?php echo $this->getControllerClass(); ?> */
  9. /* @var $data <?php echo $this->getModelClass(); ?> */
  10. ?>
  11. <div class="view">
  12. <?php
  13. echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$this->tableSchema->primaryKey}')); ?>:</b>\n";
  14. echo "\t<?php echo CHtml::link(CHtml::encode(\$data->{$this->tableSchema->primaryKey}), array('view', 'id'=>\$data->{$this->tableSchema->primaryKey})); ?>\n\t<br />\n\n";
  15. $count=0;
  16. foreach($this->tableSchema->columns as $column)
  17. {
  18. if($column->isPrimaryKey)
  19. continue;
  20. if(++$count==7)
  21. echo "\t<?php /*\n";
  22. echo "\t<b><?php echo CHtml::encode(\$data->getAttributeLabel('{$column->name}')); ?>:</b>\n";
  23. echo "\t<?php echo CHtml::encode(\$data->{$column->name}); ?>\n\t<br />\n\n";
  24. }
  25. if($count>=7)
  26. echo "\t*/ ?>\n";
  27. ?>
  28. </div>