当前位置: 首页>>代码示例>>PHP>>正文


PHP ActiveForm::className方法代码示例

本文整理汇总了PHP中yii\bootstrap\ActiveForm::className方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveForm::className方法的具体用法?PHP ActiveForm::className怎么用?PHP ActiveForm::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\bootstrap\ActiveForm的用法示例。


在下文中一共展示了ActiveForm::className方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

use yii\bootstrap\ActiveForm;
use common\components\keyStorage\FormWidget;
/* @var $this yii\web\View */
/* @var $model common\models\KeyStorageItem */
/* @var $form yii\bootstrap\ActiveForm */
$this->title = Yii::t('backend', 'Application settings');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-settings">

    <?php 
echo FormWidget::widget(['model' => $model, 'formClass' => ActiveForm::className(), 'submitText' => Yii::t('backend', 'Save'), 'submitOptions' => ['class' => 'btn btn-primary']]);
?>

</div>
开发者ID:beaten-sect0r,项目名称:yii2-core,代码行数:17,代码来源:settings.php

示例2: elseif

<?php

// Kartik ActiveForm
if ($form::className() == 'kartik\\widgets\\ActiveForm') {
    echo $form->field($alias, "[{$alias->language}]url", ['addon' => ['prepend' => ['content' => $urlPrefix]]])->textInput(['maxlength' => 255, 'name' => "Alias[{$alias->language}][url]", 'data-slugified' => 'true', 'readonly' => $readonly, 'data-duplicateable' => $duplicateable]);
    // Bootstrap ActiveForm
} elseif ($form::className() == \yii\bootstrap\ActiveForm::className()) {
    echo $form->field($alias, "[{$alias->language}]url", ['inputTemplate' => empty($urlPrefix) ? "{input}" : "<div class=\"input-group\"><span class=\"input-group-addon\">{$urlPrefix}</span>{input}</div>"])->textInput(['maxlength' => 255, 'name' => "Alias[{$alias->language}][url]", 'data-slugified' => 'true', 'readonly' => $readonly, 'data-duplicateable' => $duplicateable]);
}
开发者ID:infoweb-internet-solutions,项目名称:yii2-cms-alias,代码行数:9,代码来源:_url.php

示例3: actionUpdate

 /**
  * Updates an existing MainCategory model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $searchModel = new MainCategorySearch();
     $dataProvider = $searchModel->search(\Yii::$app->request->queryParams);
     if ($model->load(Yii::$app->request->post())) {
         if (\Yii::$app->request->isAjax) {
             \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
             return \yii\bootstrap\ActiveForm::className();
         }
         $model->attributes = $_POST['MainCategory'];
         $model->update_at = new \yii\db\Expression('NOW()');
         if ($model->save()) {
             $this->redirect(['index']);
         }
     } else {
         return $this->render('index', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     }
 }
开发者ID:deviardn,项目名称:diadoo,代码行数:25,代码来源:MainCategoryController.php


注:本文中的yii\bootstrap\ActiveForm::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。