view.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 $model <?php echo $this->getModelClass(); ?> */
  10. <?php
  11. $nameColumn=$this->guessNameColumn($this->tableSchema->columns);
  12. $label=$this->pluralize($this->class2name($this->modelClass));
  13. echo "\$this->breadcrumbs=array(
  14. '$label'=>array('index'),
  15. \$model->{$nameColumn},
  16. );\n";
  17. ?>
  18. $this->menu=array(
  19. array('label'=>'List <?php echo $this->modelClass; ?>', 'url'=>array('index')),
  20. array('label'=>'Create <?php echo $this->modelClass; ?>', 'url'=>array('create')),
  21. array('label'=>'Update <?php echo $this->modelClass; ?>', 'url'=>array('update', 'id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>)),
  22. array('label'=>'Delete <?php echo $this->modelClass; ?>', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model-><?php echo $this->tableSchema->primaryKey; ?>),'confirm'=>'Are you sure you want to delete this item?')),
  23. array('label'=>'Manage <?php echo $this->modelClass; ?>', 'url'=>array('admin')),
  24. );
  25. ?>
  26. <h1>View <?php echo $this->modelClass." #<?php echo \$model->{$this->tableSchema->primaryKey}; ?>"; ?></h1>
  27. <?php echo "<?php"; ?> $this->widget('zii.widgets.CDetailView', array(
  28. 'data'=>$model,
  29. 'attributes'=>array(
  30. <?php
  31. foreach($this->tableSchema->columns as $column)
  32. echo "\t\t'".$column->name."',\n";
  33. ?>
  34. ),
  35. )); ?>