本文整理汇总了PHP中Company::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::getList方法的具体用法?PHP Company::getList怎么用?PHP Company::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company::getList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
echo $form->errorSummary($model);
?>
<?php
echo $form->dropDownListGroup($model, 'role_id', ['widgetOptions' => ['data' => User::$roleMap, 'htmlOptions' => ['class' => 'span5']]]);
?>
<?php
echo $form->select2Group($model, 'company_id', ['widgetOptions' => ['options' => ['tags' => Company::getSelect2List(), 'createSearchChoice' => 'js:function(term, data) {
var filter = function() {
return this.text.localeCompare(term) === 0;
};
if ( $(data).filter(filter).length === 0 ) {
return {id:term, text:term};
}
}', 'tokenSeparators' => [','], 'maximumSelectionSize' => 1], 'asDropDownList' => false, 'data' => Company::getList(), 'htmlOptions' => ['class' => 'span5', 'maxlength' => 5]]]);
?>
<?php
echo $form->textFieldGroup($model, 'fullname', ['widgetOptions' => ['htmlOptions' => ['class' => 'span5', 'maxlength' => 100]]]);
?>
<?php
echo $form->textFieldGroup($model, 'email', ['widgetOptions' => ['htmlOptions' => ['class' => 'span5', 'maxlength' => 100]]]);
?>
<h5><strong><?php
echo Yii::t('main', 'Phone Numbers');
?>
:</strong></h5>
示例2: array
echo $form->labelEx($model, 'middle_name');
?>
<?php
echo $form->textField($model, 'middle_name', array('size' => 60, 'maxlength' => 255));
?>
<?php
echo $form->error($model, 'middle_name');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'company_id');
?>
<?php
echo $form->dropDownList($model, 'company_id', Company::getList(), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('person/getdepartments'), 'update' => '#Person_department_id')));
?>
<?php
echo $form->error($model, 'company_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'department_id');
?>
<?php
if (empty($model->department_id)) {
echo $form->dropDownList($model, 'department_id', array(null => 'Сначала выбери организацию'));
} else {
echo $form->dropDownList($model, 'department_id', Department::getList());
示例3: actionSql
public function actionSql()
{
if (isset($_POST['code']) && $_POST['code']) {
$sql_input = $_POST['code'];
preg_match_all('/.+;\\r\\n/sU', $sql_input, $out, PREG_SET_ORDER);
foreach ($out as $command) {
$echo .= '<br>Command:<br>';
$cmd = $command[0];
foreach (Company::getList() as $key => $company) {
$cur_cmd = preg_replace('/[0-9]+_/', $key . '_', $cmd);
$sql .= $cur_cmd . "\n";
$echo .= $cur_cmd . "<br>";
//$sql_mass[] = $cur_cmd;
}
}
try {
$rows = Yii::app()->db->createCommand($sql)->execute();
$echo = 'Success: ' . $rows . ' rows...<br>' . $echo;
} catch (Exception $e) {
$echo = 'Error!<br>' . $echo . '<br>' . $e;
}
}
$this->render('sql', array('echo' => $echo));
}