本文整理汇总了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()));
示例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));
?>
示例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;
}
}
示例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));
}
示例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;
}