本文整理匯總了PHP中Variable::model方法的典型用法代碼示例。如果您正苦於以下問題:PHP Variable::model方法的具體用法?PHP Variable::model怎麽用?PHP Variable::model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Variable
的用法示例。
在下文中一共展示了Variable::model方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
<?php
echo $form->labelEx($model, 'mensaje');
?>
<a href="javascript:;" id="clear" class="right">Limpiar</a>
<?php
echo $form->textArea($model, 'mensaje', array('rows' => 6, 'class' => 'textarea'));
?>
</div>
<div class="variable span-5 ui-sortable">
<div class="portlet">
<div class="portlet-header">Variables</div>
<div class="portlet-content">
<a href="#@phone">@phone</a>
<a href="#@name">@name</a>
<?php
foreach (Variable::model()->findAll() as $variable) {
?>
<a href="#<?php
echo $variable->valor;
?>
"><?php
echo $variable->nombre;
?>
</a>
<?php
}
?>
</div>
</div>
</div>
<div class="clear"></div>
示例2: 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.
*/
public function loadModel()
{
if ($this->_model === null) {
if (isset($_GET['id'])) {
$this->_model = Variable::model()->findbyPk($_GET['id']);
}
if ($this->_model === null) {
throw new CHttpException(404, Yii::t('App', 'The requested page does not exist.'));
}
}
return $this->_model;
}