本文整理汇总了PHP中yii\widgets\ActiveForm::end方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveForm::end方法的具体用法?PHP ActiveForm::end怎么用?PHP ActiveForm::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\ActiveForm
的用法示例。
在下文中一共展示了ActiveForm::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_form
public function api_form()
{
$model = new GuestbookModel();
$settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings;
ob_start();
$form = ActiveForm::begin(['enableClientValidation' => true, 'action' => Url::to(['/admin/guestbook/send'])]);
switch (Yii::$app->session->getFlash(GuestbookModel::FLASH_KEY)) {
case 'success':
$message = Yii::$app->getModule('admin')->activeModules['guestbook']->settings['preModerate'] ? Yii::t('easyii/guestbook/api', 'Message successfully sent and will be published after moderation') : Yii::t('easyii/guestbook/api', 'Message successfully added');
echo Alert::widget(['options' => ['class' => 'alert-success'], 'body' => $message]);
break;
case 'error':
echo Alert::widget(['options' => ['class' => 'alert-danger'], 'body' => Yii::t('easyii/guestbook/api', 'An error has occurred')]);
break;
}
echo $form->field($model, 'name');
if ($settings['enableTitle']) {
echo $form->field($model, 'title');
}
echo $form->field($model, 'text')->textarea();
if ($settings['enableCaptcha']) {
echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className());
}
echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']);
ActiveForm::end();
return ob_get_clean();
}
示例2: api_form
public function api_form($options = [])
{
$model = new FeedbackModel();
$settings = Yii::$app->getModule('admin')->activeModules['feedback']->settings;
$options = array_merge($this->_defaultFormOptions, $options);
ob_start();
$form = ActiveForm::begin(['enableClientValidation' => true, 'action' => Url::to(['/admin/feedback/send'])]);
echo Html::hiddenInput('errorUrl', $options['errorUrl'] ? $options['errorUrl'] : Url::current([self::SENT_VAR => 0]));
echo Html::hiddenInput('successUrl', $options['successUrl'] ? $options['successUrl'] : Url::current([self::SENT_VAR => 1]));
echo $form->field($model, 'name');
echo $form->field($model, 'email')->input('email');
if ($settings['enablePhone']) {
echo $form->field($model, 'phone');
}
if ($settings['enableTitle']) {
echo $form->field($model, 'title');
}
echo $form->field($model, 'text')->textarea();
if ($settings['enableCaptcha']) {
echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className());
}
echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']);
ActiveForm::end();
return ob_get_clean();
}
示例3: api_form
public function api_form($options = [])
{
$model = new Order();
$model->scenario = 'confirm';
$settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings;
$options = array_merge($this->_defaultFormOptions, $options);
ob_start();
$form = ActiveForm::begin(['action' => Url::to(['/admin/shopcart/send'])]);
echo Html::hiddenInput('errorUrl', $options['errorUrl'] ? $options['errorUrl'] : Url::current([self::SENT_VAR => 0]));
echo Html::hiddenInput('successUrl', $options['successUrl'] ? $options['successUrl'] : Url::current([self::SENT_VAR => 1]));
echo $form->field($model, 'name');
echo $form->field($model, 'address');
if ($settings['enableEmail']) {
echo $form->field($model, 'email');
}
if ($settings['enablePhone']) {
echo $form->field($model, 'phone');
}
echo $form->field($model, 'comment')->textarea();
echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']);
ActiveForm::end();
return ob_get_clean();
}
示例4: api_form
public function api_form($options = [])
{
$model = new FeedbackModel();
$settings = Yii::$app->getModule('admin')->activeModules['awarness']->settings;
$options = array_merge($this->_defaultFormOptions, $options);
ob_start();
$form = ActiveForm::begin(['enableClientValidation' => true, 'action' => Url::to(['/admin/awarness/send']), 'options' => ['class' => 'col-md-offset-4']]);
echo Html::hiddenInput('errorUrl', $options['errorUrl'] ? $options['errorUrl'] : Url::current([self::SENT_VAR => 0]));
echo Html::hiddenInput('successUrl', $options['successUrl'] ? $options['successUrl'] : Url::current([self::SENT_VAR => 1]));
echo '
<div class="form-group center-block col-md-6">';
' <input class="form-control" placeholder="Name" name="Feedback[name]">
<input class="form-control" placeholder="Subject" name="Feedback[title]">
<input class="form-control" placeholder="Your Mail" name="Feedback[email]" >
<textarea class="form-control" rows="3" placeholder="Your Message" name="Feedback[text]" id="feedback-text"></textarea>
<button type="submit" class="btn dry-btn-3 center-block">Send Request</button>
</div>
';
// echo $form->field($model, 'name');
// echo $form->field($model, 'email')->input('email');
//
// if($settings['enablePhone']) echo $form->field($model, 'phone');
// if($settings['enableTitle']) echo $form->field($model, 'title');
//
// echo $form->field($model, 'text')->textarea();
//
// if($settings['enableCaptcha']) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className());
//
// echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']);
ActiveForm::end();
return ob_get_clean();
}
示例5: actionIndex
/**
* ACTION INDEX
*/
public function actionIndex()
{
/* variable content View Employe Author: -ptr.nov-
// $searchModel_Dept = new DeptSearch();
//$dataProvider_Dept = $searchModel_Dept->search(Yii::$app->request->queryParams);
Yii::$app->Mailer->compose()
->setFrom('lg-postman@lukison.com')
->setTo('piter@lukison.com')
->setSubject('Message subject')
->setTextBody('Plain text content')
//->setHtmlBody('<b>HTML content</b>')
->send();
//return $this->render('index');
*/
$form = ActiveForm::begin();
$model = new DynamicModel(['TextBody', 'Subject']);
$model->addRule(['TextBody', 'Subject'], 'required');
$ok = 'Test LG ERP FROM HOME .... GOOD NIGHT ALL, SEE U LATER ';
$form->field($model, 'Subject')->textInput();
ActiveForm::end();
Yii::$app->mailer->compose()->setFrom(['postman@lukison.com' => 'LG-ERP-POSTMAN'])->setTo('piter@lukison.com')->setSubject('daily test email')->setTextBody($ok)->send();
/* \Yii::$app->mailer->compose()
->setFrom('postman@lukison.com')
->setTo('piter@lukison.com')
->setSubject('test subject')
->send(); */
}
示例6: api_form
public function api_form($options = [])
{
$model = new FeedbackModel();
$settings = Yii::$app->getModule('admin')->activeModules['agencies']->settings;
$options = array_merge($this->_defaultFormOptions, $options);
ob_start();
$form = ActiveForm::begin(['enableClientValidation' => true, 'action' => Url::to(['/admin/feedback/send'])]);
echo Html::hiddenInput('errorUrl', $options['errorUrl'] ? $options['errorUrl'] : Url::current([self::SENT_VAR => 0]));
echo Html::hiddenInput('successUrl', $options['successUrl'] ? $options['successUrl'] : Url::current([self::SENT_VAR => 1]));
var_dump($model->getErrors());
echo ' <input type="text" placeholder="Title" class="form-control" name="Feedback[title]" >
<input type="text" placeholder="Company Name" class="form-control" name="Feedback[name]" id="feedback-name">
<div class="help-block"></div>
<input type="text" placeholder="Phone" class="form-control" name="Feedback[phone]" >
<input type="text" placeholder="Email" class="form-control" name="Feedback[email]" >
<textarea name="Feedback[text]" id="feedback-text" class="form-control msg" rows="5" placeholder="your message"></textarea>
<div class="row">
<div class="col-md-12">
<button class="btn dry-btn center-block" type="submit">Send Request</button>
</div>
</div>';
// echo $form->field($model, 'name');
// echo $form->field($model, 'email')->input('email');
//
// if($settings['enablePhone']) echo $form->field($model, 'phone');
// if($settings['enableTitle']) echo $form->field($model, 'title');
//
// echo $form->field($model, 'text')->textarea();
//
// if($settings['enableCaptcha']) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className());
//
// echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']);
ActiveForm::end();
return ob_get_clean();
}
示例7: run
public function run()
{
$model = new \frontend\models\Search();
$form = ActiveForm::begin(['action' => '/search']);
echo $form->field($model, 'search', ['template' => '{error}{input}'])->textInput()->label(false);
echo Html::submitInput('', ['class' => 'search_submit']);
ActiveForm::end();
}
示例8: run
public function run()
{
$form = \yii\widgets\ActiveForm::begin(['id' => 'simple-search-form', 'action' => [$this->options['action']], 'enableAjaxValidation' => false]);
echo Html::textInput('search', null, ['class' => 'form-control', 'hint' => YBoard::t('yboard', 'Search')]);
echo Html::hiddenInput('type', '0');
echo Html::hiddenInput('choice', '0');
Html::submitButton('Submit', ['class' => 'small-search-button']);
\yii\widgets\ActiveForm::end();
}
示例9: render
public function render()
{
ob_start();
$form = ActiveForm::begin();
echo $form->errorSummary($this);
echo $this->renderFormFile($form, $this);
echo Html::tag('div', Html::submitButton(Yii::t('cms', 'Save'), ['class' => 'btn btn-primary']), ['class' => 'form-group']);
ActiveForm::end();
return ob_get_clean();
}
示例10: renderSummary
public function renderSummary()
{
if ($this->summary) {
$form = ActiveForm::begin(['id' => 'pagerForm', 'method' => 'post', 'options' => ['onsubmit' => 'return navTabSearch(this);']]);
echo '<input type="hidden" name="pageNum" value="1" />';
echo '<input type="hidden" name="numPerPage" value="' . $this->dataProvider->getPagination()->getPageSize() . '"/>';
echo '<input type="hidden" name="orderField" value="${param.orderField}" />';
echo '<input type="hidden" name="orderDirection" value="${param.orderDirection}" />';
ActiveForm::end();
} else {
return null;
}
}
示例11: run
/**
* Renders the widget.
*/
public function run()
{
echo Html::beginTag('div', ['class' => 'portlet-input input-inline']);
echo Html::beginTag('div', ['class' => 'input-icon right']);
echo Html::tag('i', '', ['class' => 'icon-magnifier']);
ActiveForm::begin(['action' => $this->url, 'method' => 'get']);
echo Html::activeInput('text', $this->searchModel, 'searchField', ['class' => 'form-control input-circle', 'placeholder' => 'search...', 'autofocus' => true]);
ActiveForm::end();
echo Html::endTag('div');
// portlet-input input-inline
echo Html::endTag('div');
// input-icon right
echo ' ';
echo Html::a(Html::tag('i', '', ['class' => 'fa fa-refresh']), $this->resetUrl, ['class' => 'btn btn-circle purple btn-sm', 'accesskey' => '', 'data-toggle' => 'tooltip', 'title' => 'Reset Search']);
}
示例12: run
public function run()
{
Pjax::begin(['enablePushState' => false, 'formSelector' => $this->getFormId()]);
if (\Yii::$app->session->getFlash('yii2-params-updated')) {
// TODO: review this custom alert code
$closeButton = Html::button('×', ['data-dismiss' => 'alert', 'aria-hidden' => 'true', 'class' => 'close']);
echo Html::tag('div', $closeButton . "Params updated successfully!", ['class' => 'alert-info alert fade in']);
}
/** @var \zarv1k\params\models\DynamicParam[] $models */
$models = \zarv1k\params\models\Params::getDynamicModels();
$form = ActiveForm::begin(['id' => $this->getFormId(), 'action' => \Yii::$app->getUrlManager()->createUrl("{$this->_moduleId}/manage")]);
/** @var ActiveField $activeField */
$activeField = \Yii::$container->get('yii\\widgets\\ActiveField');
// TODO: review get from di
foreach ($models as $model) {
echo $form->field($model, "[{$model->owner->id}]{$model->owner->code}", ['labelOptions' => ArrayHelper::merge($activeField->labelOptions, ['label' => $model->owner->description, 'title' => $model->owner->name]), 'inputOptions' => ArrayHelper::merge($activeField->inputOptions, ['placeholder' => $model->owner->description, 'title' => $model->owner->name])]);
}
echo Html::submitButton($this->getSubmitContent(), $this->getSubmitOptions());
ActiveForm::end();
Pjax::end();
}
示例13: getActual
/**
* @param int $mode
* @param string $selection
* @param array $items
* @param array $config
* @return string
*/
protected function getActual($mode, $selection, array $items, array $config = [])
{
switch ($mode) {
case static::MODE_NAME_VALUE_AJAX:
case static::MODE_MODEL_ATTRIBUTE_AJAX:
case static::MODE_MODEL_ATTRIBUTE_VALUE_AJAX:
/* @var $request \yii\jquery\multipleselect\tests\Request */
$request = Yii::$app->getRequest();
$request->setIsAjax(true);
}
switch ($mode) {
case static::MODE_NAME_VALUE:
case static::MODE_NAME_VALUE_AJAX:
SingleSelect::$counter = 0;
return SingleSelect::widget(array_merge($config, ['name' => 'number', 'value' => $selection, 'items' => $items]));
case static::MODE_MODEL_ATTRIBUTE_VALUE:
case static::MODE_MODEL_ATTRIBUTE_VALUE_AJAX:
$model = new TestForm();
if (array_key_exists('options', $config)) {
$config['options']['value'] = $selection;
} else {
$config['options'] = ['value' => $selection];
}
case static::MODE_MODEL_ATTRIBUTE:
case static::MODE_MODEL_ATTRIBUTE_AJAX:
if (!isset($model)) {
$model = new TestForm();
$model->number = $selection;
}
ob_start();
ob_implicit_flush(false);
$form = ActiveForm::begin();
$actual = (string) $form->field($model, 'number', ['template' => '{input}'])->widget(SingleSelect::className(), array_merge($config, ['items' => $items]));
ActiveForm::end();
ob_end_clean();
return $actual;
}
throw new Exception();
}
示例14: addEventHandler
</div>
<div class="col-xs-1">
<div class="cond-accion2">
<a id="atr-cond-del" class="del-orden" title="Eliminar orden"><span class="glyphicon glyphicon-remove"></span></a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="errores">Hay errores en las consultas, <br> Debe haber campos o atributos incompletos.</div>
</div>
<div class="row listar">
<?php $form = ActiveForm::begin(['options' => ['id' => 'formfiltro']]); ?>
<input id="consulta" name="consulta" type="hidden"></input>
<div id="btn-listar" class="btn btn-primary" title="Imprimir Listado">Imprimir Listado</div>
</form><?php ActiveForm::end(); ?>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
var comparadores = document.querySelectorAll(".comparador");
for(var i=0;i<comparadores.length;i++){
var comp=comparadores[i];
addEventHandler(comp,'dragstart',dragStart);
}
var atributos = document.querySelectorAll(".btn-atributo");
示例15: run
public function run()
{
ActiveForm::end();
echo Html::endTag('div');
echo Html::endTag('div');
}