<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ // 文本框:textInput(); // 密碼框:passwordInput(); // 單選框:radio(),radioList(); // 復選框:checkbox(),checkboxList(); // 下拉框:dropDownList(); // 隱藏域:hiddenInput(); // 文本域:textarea(['rows'=>3]); // 文件上傳:fileInput(); // 提交按鈕:submitButton(); // 重置按鈕:resetButtun(); // 設置表單屬性 <?php $form = ActiveForm::begin([ // 'action' => ['log/login'], //提交地址(*可省略*) // 'method'=>'post', //提交方法(*可省略默認POST*) // 'id' => 'login-form', //設置ID屬性 'options' => [ 'class' => 'form-horizontal', //設置class屬性 'enctype' => 'multipart/form-data' //文件上傳時添加該編碼 ], 'fieldConfig' => [ 'template' => '<div class="form-group"> <center> <label class="col-md-2 control-label" for="type-name-field">{label}</label> </center> <div class="col-md-8 controls">{input}{error}</div> </div>' ], //設置模板的樣式 ]); ?> // 添加表單內容 <!--文本框 (*驗證長度可在這里寫 maxlength 這樣就不用再 model 里面寫了 *)--> <? echo $form->field($model, 'username', ['inputOptions' => ['placeholder'=>'請輸入用戶名', 'class' => 'ipt'], 'template'=>' <div class="form-group"> <div class="col-md-8 controls">{label}{input}{error}</div> </div> '])->textInput(['maxlength' => 20,"class" => "span12", "placeholder" => "管理員賬號"]) ?> <!--密碼框 (*不使用他的lable只需要用false把他禁止, 然后你可以自己寫*)--> <?= $form->field($model, 'pwd')->label(false)->passwordInput([ 'maxlength' => 20, "style"=>"width:200px; height:30px;", "placeholder"=>"請輸入您的密碼" ]) ?> <!--單選按鈕(*設置默認選中*)--> <?php $model->sex=1; echo $form->field($model, 'sex')->radioList(['1'=>'男','0'=>'女']) ?> <!--驗證郵箱--> <?= $form->field($model, 'email')->textInput() ?> <!--下拉框的默認選中使用 prompt 設置 --> <?= $form->field($model, 'school')->dropDownList(['1'=>'大學','2'=>'高中','3'=>'初中'], ['prompt'=>'請選擇','style'=>'width:120px']) ?> <!--文件上傳--> <?= $form->field($model, 'photo')->fileInput() ?> <!--復選框 --> <?= $form->field($model, 'hobby')->checkboxList(['0'=>'籃球','1'=>'足球','2'=>'羽毛球','3'=>'乒乓球']) ?> <!--文本域--> <?= $form->field($model, 'remark')->textarea(['rows'=>3]) ?> <!--隱藏域--> <?= $form->field($model, 'userid')->hiddenInput(['value'=>3])->label(false); ?> <a href="<?php echo yii\helpers\Url::to(['public/seekpassword']); ?>" class="forgot">忘記密碼?</a> // 修改某一列的html <?php echo $form->field($model, 'rememberMe',[ 'template' => '<div class="remember">{input}<label for="remember-me">記住我</label></div>', ])->checkbox([ 'id' => 'remember-me', ]); ?> // 按鈕 <?php echo Html::submitButton('登錄', ["class" => "btn-glow primary login"]); ?> <? echo Html::submitButton('提交', ['class'=>'btn btn-primary','name' =>'submit-button']) ?> <? echo Html::resetButton('重置', ['class'=>'btn btn-primary','name' =>'submit-button']) ?> // 表單結束 <?php ActiveForm::end(); ?> ~~~ 默認選中,只要設置 $form->字段 的值即可。 # Yii2 百度編輯器 - Yii2-ueditor-widget 百度UEditor GitHub地址 https://github.com/BigKuCha/yii2-ueditor-widget 安裝 `$ php composer.phar require kucha/ueditor "*"` or add `"kucha/ueditor": "*"` to the require section of your composer.json file. 應用 controller內定義一個方法,用于配置編輯器: ~~~ public function actions() { return [ 'upload' => [ 'class' => 'kucha\ueditor\UEditorAction', ] ]; } ~~~ view內調用編輯器: ~~~ <?php echo \kucha\ueditor\UEditor::widget([]); ?> ~~~ 或者: ~~~ <?php echo $form->field($model,'colum')->widget('kucha\ueditor\UEditor',[]); ?> ~~~ 說明 ueditor只支持2種語言,`en-us`和`zh-cn`,默認跟隨系統語言 `Yii::$app->language`,可以通過2種方式設置: 1.修改系統語言,在main.php(高級版) 或者web.php(基礎版)添加`'language' => 'zh-CN',`。 2.實例化的時候配置語言選項,見下邊配置 3. **配置相關** 編輯器相關配置,請在view 中配置,參數為clientOptions,比如定制菜單,編輯器大小等等,具體參數請查看UEditor官網文檔。 簡單實例: ~~~ use \kucha\ueditor\UEditor; echo UEditor::widget([ 'clientOptions' => [ //編輯區域大小 'initialFrameHeight' => '200', //設置語言 'lang' =>'en', //中文為 zh-cn //定制菜單 'toolbars' => [ [ 'fullscreen', 'source', 'undo', 'redo', '|', 'fontsize', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', '|', 'lineheight', '|', 'indent', '|' ], ] ]); ~~~ 文件上傳相關配置,請在controller中配置,參數為config,例如文件上傳路徑等;更多參數請參照 config.php (跟UEditor提供的config.json一樣) 簡單實例: ~~~ public function actions() { return [ 'upload' => [ 'class' => 'kucha\ueditor\UEditorAction', 'config' => [ "imageUrlPrefix" => "http://www.phpxmn.com", //圖片訪問路徑前綴 "imagePathFormat" => "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}" //上傳保存路徑 ], ] ]; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看