当前位置: 首页>>代码示例>>PHP>>正文


PHP Gender::model方法代码示例

本文整理汇总了PHP中Gender::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Gender::model方法的具体用法?PHP Gender::model怎么用?PHP Gender::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gender的用法示例。


在下文中一共展示了Gender::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

echo $form->textField($model, 'last_name');
?>
</td>
		<td><?php 
echo $form->error($model, 'last_name');
?>
</td>
	</div></tr>
        
        <tr><div class="row">
                    <td><?php 
echo $form->labelEx($model, 'gender');
?>
</td>
                    <td><?php 
echo $form->dropdownList($model, 'gender', CHtml::listData(Gender::model()->findAll(), 'id', 'gender'), array('prompt' => 'Select Gender'));
?>
</td>
                    <td><?php 
echo $form->error($model, 'gender');
?>
</td>
       </div></tr>
        
        <tr><div class="row">
		<td><?php 
echo $form->labelEx($model, 'dob');
?>
</td>
		<td> <?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'dob', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd', 'minDate' => ''), 'htmlOptions' => array()));
开发者ID:nomannoor,项目名称:social-property,代码行数:31,代码来源:editprofile.php

示例2: array

echo $form->textArea($element, 'address', array(), false, array('rows' => 4), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->textField($element, 'postcode', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->textField($element, 'email', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->textField($element, 'telephone', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->datePicker($element, 'date_of_birth', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->dropDownList($element, 'gender_id', CHtml::listData(Gender::model()->findAll(), 'id', 'name'), array('empty' => '- Please Select -'), false, array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->dropDownList($element, 'ethnic_group_id', CHtml::listData(EthnicGroup::model()->findAll(), 'id', 'name'), array('empty' => '- Please Select -'), false, array('label' => 4, 'field' => 8));
?>
    </div>
    <div class="large-6 column">
        <?php 
echo $form->textField($element, 'nhs_number', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->textField($element, 'gp_name', array(), array(), array('label' => 4, 'field' => 8));
?>
        <?php 
echo $form->textArea($element, 'gp_address', array(), false, array('rows' => 4), array('label' => 4, 'field' => 8));
?>
开发者ID:openeyes,项目名称:openeyes,代码行数:31,代码来源:form_Element_OphCoCvi_Demographics.php

示例3: mapGenderFromPatient

 /**
  * @param \Patient $patient
  */
 protected function mapGenderFromPatient(\Patient $patient)
 {
     $gender_string = $patient->getGenderString();
     $gender = \Gender::model()->findByAttributes(array('name' => $gender_string));
     if ($gender) {
         $this->gender_id = $gender->id;
     }
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:11,代码来源:Element_OphCoCvi_Demographics.php

示例4: actionViewProfile

 public function actionViewProfile($userId)
 {
     $this->layout = "layout_profile";
     $user = UserProfile::model()->find('user_id=:userId', array(':userId' => $userId));
     $country = Country::model()->find('id=:cId', array(':cId' => $user->country_id));
     $gender = Gender::model()->find('id=:gId', array(':gId' => $user->gender));
     $userFriend = UserFriend::model()->find('user_id=:userId AND friend_id=:friendId AND status=:status', array(':userId' => Yii::app()->user->userId, ':friendId' => $user->user_id, ':status' => 0));
     $userFriend2 = UserFriend::model()->find('user_id=:userId AND friend_id=:friendId AND status=:status', array(':userId' => $user->user_id, ':friendId' => Yii::app()->user->userId, ':status' => 0));
     $isFriend = UserFriend::model()->find('user_id=:userId AND friend_id=:friendId AND status=:status', array(':userId' => Yii::app()->user->userId, ':friendId' => $user->user_id, ':status' => 1));
     $isFriend2 = UserFriend::model()->find('user_id=:userId AND friend_id=:friendId AND status=:status', array(':userId' => $user->user_id, ':friendId' => Yii::app()->user->userId, ':status' => 1));
     //$posts = Post::model()->findAll(array('select' => '*','condition' => 'user_id=:userId','params' => array(':userId' => $userId),'order'=>'date DESC'));
     //$posts = PostTagging::model()->with('post')->findAll(array('select' => '*','distinct'=>true,'condition' => 't.user_id=:userId OR t.sender_id=:userId','params' => array(':userId' => $userId),'order'=>'post.date DESC'));
     $posts = PostTagging::model()->findAllBySql("SELECT DISTINCT( post_id ) AS post_id FROM post_tagging,posts WHERE post_tagging.user_id={$userId} OR post_tagging.sender_id={$userId} ORDER By post_tagging.id DESC");
     if (!empty($posts)) {
         foreach ($posts as $p) {
             $post[] = Post::model()->find(array('select' => '*', 'condition' => 'id=:postId', 'params' => array(':postId' => $p->post_id), 'order' => 'date DESC'));
         }
     } else {
         $post = Null;
     }
     $CheckuserFriend = UserFriend::model()->find('(user_id=:userId AND friend_id=:friendId) OR (user_id=:friendId AND friend_id=:userId) AND status=1', array(':userId' => Yii::app()->user->userId, ':friendId' => $userId));
     $this->render('viewprofile', array('posts' => $post, 'model' => $user, 'country' => $country, 'gender' => $gender, 'userFriend' => $userFriend, 'userFriend2' => $userFriend2, 'isFriend' => $isFriend, 'isFriend2' => $isFriend2, 'checkFriend' => $CheckuserFriend));
 }
开发者ID:nomannoor,项目名称:social-property,代码行数:23,代码来源:UserController.php

示例5: loadModel

 /**
  * 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 Gender the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Gender::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:reubsc,项目名称:sds,代码行数:15,代码来源:GenderController.php


注:本文中的Gender::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。