本文整理汇总了PHP中yii\bootstrap\ActiveForm::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveForm::init方法的具体用法?PHP ActiveForm::init怎么用?PHP ActiveForm::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\ActiveForm
的用法示例。
在下文中一共展示了ActiveForm::init方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->fieldConfig = ['template' => "<div class=\"row\">\n <div class=\"col-xs-6\">{label}</div>\n <div class=\"col-xs-6\"> <span class=\"tooltip-field pull-right\"> {hint} </span> <span class=\"tooltip-error-field pull-right\"> {error} </span> </div>\n \n<div class=\"col-xs-12\">{input}</div>\n </div>"];
$this->fieldClass = ActiveField::className();
echo Html::tag('span', AmosIcons::show('alert'), ['id' => 'errore-alert-common', 'class' => 'errore-alert bk-noDisplay', 'title' => \Yii::t('app', 'La tab contiene degli errori')]);
parent::init();
}
示例2: init
/**
* @inheritdoc
*/
public function init()
{
if ($this->pjax) {
$this->options['data-pjax'] = 1;
}
parent::init();
}
示例3: init
public function init()
{
$this->initForm();
if (empty($this->fieldConfig['options']) && $this->floatingLabel && $this->layout !== 'horizontal') {
$this->fieldConfig['options'] = ['class' => 'form-group floating-label'];
}
parent::init();
}
示例4: init
public function init()
{
$this->setId(uniqid($this->getId()));
if ($this->readOnly) {
$this->fieldConfig['readOnly'] = true;
}
parent::init();
}
示例5: init
public function init()
{
ob_start();
ob_implicit_flush(false);
parent::init();
ob_end_clean();
echo Html::beginTag('div', $this->options);
}
示例6: init
public function init()
{
parent::init();
$controller = $this->getView()->context;
$this->targetClass = $controller->id . '_' . $controller->action->id . '_' . $this->targetClass;
echo Html::beginTag('div', ['class' => 'panel panel-info']);
echo Html::tag('div', __('Search'), ['class' => 'panel-heading', 'data-target-class' => $this->targetClass]);
echo Html::beginTag('div', ['class' => 'panel-body ' . $this->targetClass]);
}
示例7: init
public function init()
{
$this->fieldConfig['horizontalCssClasses']['label'] = 'col-sm-' . $this->labelCols;
$this->fieldConfig['horizontalCssClasses']['wrapper'] = 'col-sm-' . (self::COLS_TOTAL - $this->labelCols);
parent::init();
$params = Yii::$app->request->queryParams;
if (!empty($params['_return_url'])) {
echo Html::hiddenInput('_return_url', $params['_return_url']);
}
}
示例8: init
public function init()
{
parent::init();
$controller = $this->getView()->context;
$this->targetClass = $controller->id . '_' . $controller->action->id . '_' . $this->targetClass;
echo Html::beginTag('div', ['class' => 'panel panel-info search-form']);
echo Html::tag('div', __('Search'), ['class' => 'panel-heading app-toggle app-toggle-save pointer', 'data-target-class' => $this->targetClass]);
$this->extraClass = empty($_COOKIE['app-toggle-' . $this->targetClass]) ? 'h ' : '';
echo Html::beginTag('div', ['class' => 'panel-body ' . $this->extraClass . $this->targetClass]);
}
示例9: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// $id = $this->options['id'];
$clientSideKey = Yii::$app->get('braintree')->clientSideKey;
$view = $this->getView();
BraintreeAsset::register($view);
// $view->registerJs("braintree.setup('$clientSideKey', 'custom', {id: '$id'});");
$view->registerJs("braintreeClient = new braintree.api.Client({clientToken: '{$clientSideKey}'});");
$this->fieldClass = ActiveField::className();
}
示例10: init
/**
* Adds some default configuration. I.e. form name and layout class.
* @inheritdoc
*/
public function init()
{
if (!in_array($this->layout, ['default', 'horizontal', 'inline'])) {
throw new InvalidConfigException('Invalid layout type: ' . $this->layout);
}
if ($this->layout !== 'default') {
Html::addCssClass($this->options, 'form-' . $this->layout);
}
if ($this->name) {
$this->options['name'] = $this->name;
}
parent::init();
}
示例11: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->buttonGroupOptions = array_merge(['class' => 'btn-group'], $this->buttonGroupOptions);
if ($this->displaySubmitButton) {
if (!$this->submitButtonLabel) {
$this->submitButtonLabel = Yii::t('app', 'Submit');
}
$this->buttons[] = Html::submitButton($this->submitButtonLabel, $this->submitButtonOptions);
}
if ($this->displayResetButton) {
if (!$this->resetButtonLabel) {
$this->resetButtonLabel = Yii::t('app', 'Reset');
}
$this->buttons[] = Html::resetButton($this->resetButtonLabel, $this->resetButtonOptions);
}
}
示例12: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
BraintreeAsset::register($this->getView());
$this->fieldClass = ActiveField::className();
}
示例13: init
/**
* in controller app\modules\main\controllers\ContactController
* public function actionAjax($form)
* {
* case 'call';
* $model = new CallForm(); / your Model form
* break;
* }
* in view
* <?= Html::a('Оценка-ТЛ', ['/main/contact/ajax', 'form'=>'call'], ['class'=>'ajax-popup'])?>
*/
public function init()
{
ob_start();
parent::init();
}