update.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * This is the template for generating the update view for crud.
  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. <?php
  11. echo "<?php\n";
  12. $nameColumn=$this->guessNameColumn($columns);
  13. $label=$this->class2name($modelClass,true);
  14. echo "\$this->breadcrumbs=array(
  15. '$label'=>array('index'),
  16. \$model->{$nameColumn}=>array('view','id'=>\$model->{$ID}),
  17. 'Update',
  18. );\n";
  19. ?>
  20. $this->menu=array(
  21. array('label'=>'List <?php echo $modelClass; ?>', 'url'=>array('index')),
  22. array('label'=>'Create <?php echo $modelClass; ?>', 'url'=>array('create')),
  23. array('label'=>'View <?php echo $modelClass; ?>', 'url'=>array('view', 'id'=>$model-><?php echo $ID; ?>)),
  24. array('label'=>'Manage <?php echo $modelClass; ?>', 'url'=>array('admin')),
  25. );
  26. ?>
  27. <h1>Update <?php echo $modelClass." <?php echo \$model->{$ID}; ?>"; ?></h1>
  28. <?php echo "<?php echo \$this->renderPartial('_form', array('model'=>\$model)); ?>"; ?>