本文整理汇总了PHP中Country::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::unsetAttributes方法的具体用法?PHP Country::unsetAttributes怎么用?PHP Country::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::unsetAttributes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdmin
public function actionAdmin()
{
$model = new Country('search');
$model->unsetAttributes();
if (isset($_GET['Country'])) {
$model->setAttributes($_GET['Country']);
}
$this->render('admin', array('model' => $model));
}
示例2: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Country('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Country'])) {
$model->attributes = $_GET['Country'];
}
$this->render('admin', array('model' => $model));
}
示例3: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
//Countries with given Time Zone
$country = new Country('search');
$country->unsetAttributes();
// clear any default values
$country->timeZoneID = $id;
if (isset($_GET['Country'])) {
$country->attributes = $_GET['Country'];
}
//Users with given Time Zone
$profile = new Profile('search');
$profile->unsetAttributes();
$profile->timeZoneID = $id;
if (isset($_GET['Profile'])) {
$profile->attributes = $_GET['Profile'];
}
$this->render('view', array('model' => $this->loadModel($id), 'country' => $country, 'profile' => $profile));
}
示例4: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
parent::actionIndex();
$model = new Country('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Country'])) {
$model->attributes = $_GET['Country'];
}
if (isset($_GET['pageSize'])) {
Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
unset($_GET['pageSize']);
// would interfere with pager and repetitive page size change
}
$this->render('index', array('model' => $model));
}
示例5: array
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'province-form', 'enableAjaxValidation' => false));
$this->widget('ToolbarButton', array('isSave' => true, 'UrlSave' => 'province/write', 'isCancel' => true, 'UrlCancel' => 'province/cancelwrite'));
echo $form->hiddenField($model, 'provinceid');
?>
<div class="row">
<?php
echo $form->labelEx($model, 'countryid');
echo $form->hiddenField($model, 'countryid');
?>
<input type="text" name="countryname" id="countryname" readonly >
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'country_dialog', 'options' => array('title' => Yii::t('app', 'Country'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$country = new Country('searchwstatus');
$country->unsetAttributes();
// clear any default values
if (isset($_GET['Country'])) {
$country->attributes = $_GET['Country'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'product-grid', 'dataProvider' => $country->Searchwstatus(), 'filter' => $country, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
array("name" => "send_product",
"id" => "send_product",
"onClick" => "$(\\"#country_dialog\\").dialog(\\"close\\"); $(\\"#countryname\\").val(\\"$data->countryname\\"); $(\\"#Province_countryid\\").val(\\"$data->countryid\\");
"))'), array('name' => 'countryid', 'visible' => false, 'value' => '$data->countryid', 'htmlOptions' => array('width' => '1%')), 'countryname')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#country_dialog").dialog("open"); return false;'));
?>
<?php
echo $form->error($model, 'countryid');
?>
示例6: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
if ($this->CanAccess("admin")) {
$model = new Country('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Country'])) {
$model->attributes = $_GET['Country'];
}
$this->render('admin', array('model' => $model));
} else {
throw new CHttpException(405, Yii::t('app', 'You do not have permissions to access this page.'));
}
}