Пример #1
0
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'imagesdetail-form', 'htmlOptions' => array('enctype' => 'multipart/form-data'), 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

    <div class="control-group">
		<?php 
echo $form->labelEx($model, 'albumid');
?>
		<?php 
echo $form->dropDownList($model, 'albumid', Albumimages::loadAllData());
?>
		<?php 
echo $form->error($model, 'albumid');
?>
	</div>

	<div class="control-group">
		<?php 
echo $form->labelEx($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('size' => 255, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'name');
Пример #2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Albumimages the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Albumimages::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }