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


PHP CHtml::beginForm方法代码示例

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


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

示例1: formButton

 /**
  * @param array $options
  * @return string
  */
 public function formButton($options = array())
 {
     $form = CHtml::beginForm($this->url(), 'get');
     $form .= CHtml::hiddenField('business', $this->business);
     foreach (CMap::mergeArray($this->defaultOptions, $options) as $k => $v) {
         $form .= CHtml::hiddenField($k, $v);
     }
     $form .= CHtml::imageButton($this->image, array('border' => 0, 'alt' => $this->imageAltText));
     $form .= CHtml::endForm();
     return $form;
 }
开发者ID:cornernote,项目名称:yii-dressing,代码行数:15,代码来源:YdPayPalHelper.php

示例2: testBeginForm

 /**
  * @dataProvider providerBeginForm
  *
  * @param string $action
  * @param string $method
  * @param array $htmlOptions
  * @param string $assertion
  */
 public function testBeginForm($action, $method, $htmlOptions, $assertion)
 {
     /* TODO - Steven Wexler - 3/5/11 - Mock out static methods in this function when CHtml leverages late static method binding
      * because PHPUnit.  This is only possible Yii supports only >= PHP 5.3   - */
     $this->assertEquals($assertion, CHtml::beginForm($action, $method, $htmlOptions));
     $this->assertEquals($assertion, CHtml::form($action, $method, $htmlOptions));
 }
开发者ID:robregonm,项目名称:yii,代码行数:15,代码来源:CHtmlTest.php

示例3: run

    public function run()
    {
        //begin form
        echo CHtml::beginForm($this->action, $this->method, array('id' => $this->id, 'enctype' => $this->enctype, 'class' => $this->class));
        foreach ($this->model as $item) {
            if ($this->selector) {
                echo CHtml::checkBox('selector_' . $item['key']);
            }
            $name = Awecms::generateFriendlyName($item["key"]);
            ?>
            <div class="settings row">
                <?php 
            echo $this->getlabel($item['key']);
            switch ($item['type']) {
                //add new types here
                case 'textfield':
                    echo $this->getFullTextField($item);
                    break;
                case 'boolean':
                    echo CHtml::hiddenField($item['key'], 0);
                    echo CHtml::checkBox($item['key'], $item['value']);
                    break;
                case 'image_url':
                    echo $this->getFullTextField($item);
                    echo "<a class=\"right\" href=\"{$item["value"]}\" target=\"_blank\"><img src=\"{$item["value"]}\" title=\"{$name}\" alt=\"{$name}\" /></a>";
                    break;
                case 'email':
                    echo $this->getFullTextField($item);
                    break;
                case 'textarea':
                    echo CHtml::textArea($item['key'], $item['value']);
                case 'NULL':
                    break;
                default:
                    echo "Unsupported type: " . $item['type'] . " of " . $item['key'] . " with value " . $item['value'] . "<br/>";
                    break;
            }
            if (isset($item['hint'])) {
                ?>
                    <p class="hint">
                        <?php 
                echo $item['hint'];
                ?>
                    </p>
                    <?php 
            }
            ?>

            </div>
            <?php 
        }
        ?>
        <div class="row buttons">
            <?php 
        echo CHtml::submitButton('Submit!');
        ?>
        </div>
        <?php 
        echo CHtml::endForm();
    }
开发者ID:awecode,项目名称:awecms,代码行数:60,代码来源:EDynamicForm.php

示例4: form

function form($name, $label, $action, $dis = array())
{
    echo CHtml::beginForm('', 'POST');
    echo CHtml::submitButton($label, $dis + array('style' => 'float: left'));
    echo CHtml::hiddenField('action', $action);
    echo CHtml::hiddenField('name', $name);
    echo CHtml::endForm();
}
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:8,代码来源:bgPlugin.php

示例5: run

 /**
  * Generates the required HTML and Javascript
  */
 public function run()
 {
     //echo 'Chức năng upload file tạm thời Off để bảo trì, liên hệ trangptk@vega.com.vn';
     list($name, $id) = $this->resolveNameID();
     $model = $this->model;
     if (!isset($this->options['uploadTable'])) {
         $uploadTable = "files";
         $this->options['uploadTable'] = "#files";
     } else {
         $uploadTable = $this->options['uploadTable'];
         $this->options['uploadTable'] = "#{$uploadTable}";
     }
     if (!isset($this->options['downloadTable'])) {
         $downloadTable = "files";
         $this->options['downloadTable'] = "#files";
     } else {
         $downloadTable = $this->options['downloadTable'];
         $this->options['downloadTable'] = "#{$downloadTable}";
     }
     if (!isset($this->options['buildUploadRow'])) {
         $this->options['buildUploadRow'] = $this->_getBuildUploadRow();
     }
     if (!isset($this->options['buildDownloadRow'])) {
         $this->options['buildDownloadRow'] = $this->_getBuildDownloadRow();
     }
     if (!isset($this->htmlOptions['enctype'])) {
         $this->htmlOptions['enctype'] = 'multipart/form-data';
     }
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = 'xupload-form file_upload';
     }
     if (!isset($this->htmlOptions['id'])) {
         $this->htmlOptions['id'] = get_class($model) . "_form";
     }
     $options = CJavaScript::encode($this->options);
     CVarDumper::dumpAsString($options, 10, true);
     Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $this->htmlOptions['id'], "jQuery('#{$this->htmlOptions['id']}').fileUploadUI({$options});", CClientScript::POS_READY);
     //echo "<pre>";print_r($options);exit();
     echo CHtml::beginForm($this->url, 'post', $this->htmlOptions);
     $htmlOptions = array();
     if ($this->multiple) {
         $htmlOptions["multiple"] = true;
     }
     if ($this->hasModel()) {
         echo CHtml::activeFileField($this->model, $this->attribute, $htmlOptions);
     } else {
         echo CHtml::fileField($name, $this->value, $htmlOptions);
     }
     echo CHtml::tag("button", array(), "Upload", true);
     echo CHtml::tag("div", array(), $this->text, true);
     echo CHtml::endForm();
     if ($uploadTable == $downloadTable) {
         echo CHtml::tag("table", array("id" => $uploadTable), "", true);
     } else {
         echo CHtml::tag("table", array("id" => $uploadTable), "", true);
         echo CHtml::tag("table", array("id" => $downloadTable), "", true);
     }
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:61,代码来源:XUploadWidget.php

示例6: beginForm

 public static function beginForm($action = '', $method = 'post', $htmlOptions = array())
 {
     if (isset($htmlOptions['class'])) {
         $htmlOptions['class'] = $htmlOptions['class'] . ' uniForm';
     } else {
         $htmlOptions['class'] = 'uniForm';
     }
     return parent::beginForm($action, $method, $htmlOptions);
 }
开发者ID:zarethernet,项目名称:yaamp,代码行数:9,代码来源:CUFHtml.php

示例7: headEnableAjax

 public function headEnableAjax()
 {
     echo CHtml::beginForm();
     echo CHtml::openTag('label', array('class' => 'checkbox pull-right', 'style' => 'margin:5px 10px 0px 0px;', 'for' => 'ajaxUpdate'));
     echo "Aktifkan mode Ajax ";
     echo CHtml::Checkbox('ajaxUpdate', Yii::app()->user->getState('ajaxUpdate', true), array('uncheckValue' => 0, 'onclick' => "this.form.submit();"));
     echo CHtml::closetag("label");
     echo CHtml::endForm();
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:9,代码来源:CmsGridView.php

示例8: run

 public function run()
 {
     $placeholder = $this->type ? Yii::t('app', 'Search') . ' ' . ucfirst($this->type) . '...' : Yii::t('app', 'Search') . '...';
     echo CHtml::beginForm(array('/search/' . $this->type), 'get', array('class' => 'search-form'));
     echo CHtml::textField('q', $this->query, array('placeholder' => $placeholder));
     if ($this->query != '') {
         echo CHtml::submitButton('Search!', array('name' => ''));
     }
     echo CHtml::endForm('');
 }
开发者ID:awecode,项目名称:awecms,代码行数:10,代码来源:SearchBlock.php

示例9: run

 public function run()
 {
     echo CHtml::beginForm('', 'post', array('id' => $this->htmlOptions['id'] . '-form'));
     echo CHtml::button($this->inputButtonLabel, array('onclick' => "jQuery(\"#{$this->htmlOptions['id']}\").jsoneditor('input')"));
     echo CHtml::button($this->initButtonLabel, array('onclick' => "jQuery(\"#{$this->htmlOptions['id']}\").jsoneditor('init')"));
     echo CHtml::submitButton($this->submitButtonLabel, array('name' => $this->htmlOptions['id'] . '-save'));
     echo CHtml::tag('div', $this->htmlOptions);
     echo CHtml::hiddenField($this->htmlOptions['id'] . '-json', '', array());
     echo CHtml::endForm();
 }
开发者ID:ranvirp,项目名称:rdp,代码行数:10,代码来源:JSONEditorView.php

示例10: renderCsvButton

 public function renderCsvButton()
 {
     echo CHtml::beginForm(array('//user/csv/select'));
     foreach ($this->columns as $column) {
         if (isset($column->name)) {
             echo CHtml::hiddenField($column->name, $column->value);
         }
     }
     printf('<td>%s</td>', CHtml::submitButton('CSV'));
     echo CHtml::endForm();
 }
开发者ID:kumarsivarajan,项目名称:yii-user-management,代码行数:11,代码来源:CsvGridView.php

示例11: beginForm

 public function beginForm()
 {
     if ($this->form) {
         echo CHtml::beginForm($this->action, $this->method, $this->formHtmlOptions);
     } else {
         echo CHtml::openTag('div', array('class' => 'settingswidget', 'id' => $this->getId()));
     }
     if (isset($this->title)) {
         echo CHtml::tag('legend', array(), $this->title);
     }
 }
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:11,代码来源:SettingsWidget.php

示例12: beginForm

 public function beginForm()
 {
     if ($this->form) {
         echo CHtml::beginForm($this->action, $this->method, $this->formHtmlOptions);
     } else {
         $this->fieldHtmlOptions = array_replace($this->formHtmlOptions, $this->fieldHtmlOptions);
     }
     echo CHtml::openTag('fieldset', array_replace($this->fieldHtmlOptions, array('id' => $this->getId())));
     if (isset($this->title)) {
         echo CHtml::tag('legend', array(), $this->title);
     }
 }
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:12,代码来源:SettingsWidget.php

示例13: sortOrder

 public function sortOrder($model, $ID)
 {
     $sortModel = $this->loadModelWidget($ID);
     echo CHtml::beginForm();
     $sort = array();
     for ($i = 1; $i <= count($model); $i++) {
         $sort[$i] = $i;
     }
     echo CHtml::hiddenField('WidgetSortID', $ID);
     echo CHtml::dropDownList('WidgetSortOrder', $sortModel->sort, $sort, array('class' => 'span4 pull-right', 'prompt' => '-Sort Order-', 'style' => 'margin-top:-40px;', 'onchange' => "this.form.submit();"));
     echo CHtml::endForm();
     echo "<br>";
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:13,代码来源:WidgetController.php

示例14: run

 /**
  *
  */
 public function run()
 {
     /** @var AccountModule $account */
     $account = Yii::app()->getModule('account');
     $cs = Yii::app()->getClientScript();
     $assetsUrl = $account->getAssetsUrl() . '/hybridAuth';
     $cs->registerCoreScript('jquery');
     $cs->registerCoreScript('jquery.ui');
     $cs->registerCssFile($cs->getCoreScriptUrl() . '/jui/css/base/jquery-ui.css');
     $cs->registerScriptFile($assetsUrl . '/script.js');
     $cs->registerCssFile($assetsUrl . '/styles.css');
     $cs->registerCssFile($assetsUrl . '/zocial/css/zocial.css');
     $providers = $account->hybridAuthConfig['providers'];
     echo '<div id="hybridauth-openid-div">';
     echo '<p>' . Yii::t('account', 'Enter your OpenID identity or provider:') . '</p>';
     echo CHtml::beginForm(Yii::app()->createUrl($this->baseUrl, array('returnUrl' => Yii::app()->returnUrl->getLinkValue(true))), 'get', array('id' => 'hybridauth-openid-form'));
     echo CHtml::hiddenField('provider', 'openid');
     echo CHtml::textField('openid_identifier');
     echo CHtml::endForm();
     echo '</div>';
     echo '<div id="hybridauth-confirm-unlink">';
     echo '<p>' . Yii::t('account', 'Are you sure you want to unlink this provider?') . '</p>';
     echo CHtml::beginForm(Yii::app()->createUrl($this->baseUrl, array('action' => 'unlink', 'returnUrl' => Yii::app()->returnUrl->getLinkValue(true))), 'post', array('id' => 'hybridauth-unlink-form'));
     echo CHtml::hiddenField('provider', '', array('id' => 'hybridauth-unlink-provider'));
     echo CHtml::endForm();
     echo '</div>';
     echo '<ul id="hybridauth-provider-list">';
     foreach ($providers as $provider => $settings) {
         if ($settings['enabled'] == true) {
             echo '<li>';
             echo CHtml::link(Yii::t('account', isset($settings['name']) ? $settings['name'] : $provider), array($this->baseUrl, 'provider' => $provider, 'returnUrl' => Yii::app()->returnUrl->getLinkValue(true)), array('id' => 'hybridauth-provider-' . strtolower($provider), 'class' => 'zocial ' . strtolower($provider)));
             echo '</li>';
         }
     }
     echo '</ul>';
     if (!Yii::app()->user->isGuest) {
         $userHybridAuths = CActiveRecord::model($account->userHybridAuthClass)->findAllByAttributes(array($account->userIdField => Yii::app()->user->id));
         if ($userHybridAuths) {
             echo '<h4>' . Yii::t('account', 'Linked Services') . '</h4>';
             echo '<ul id="hybridauth-account-list">';
             /** @var AccountUserHybridAuth[] $userHybridAuths */
             foreach ($userHybridAuths as $userHybridAuth) {
                 $provider = $userHybridAuth->{$account->providerField};
                 echo '<li>';
                 echo CHtml::link($userHybridAuth->{$account->emailField}, 'javascript:void(0);', array('id' => 'hybridauth-account-' . strtolower($provider), 'class' => 'zocial ' . strtolower($provider)));
                 echo '</li>';
             }
             echo '</ul>';
         }
     }
 }
开发者ID:cornernote,项目名称:yii-account-module,代码行数:54,代码来源:AccountHybridAuthWidget.php

示例15: actionIndex

 public function actionIndex($path = '/')
 {
     $fsw = new FilesystemWrapper('/home/rosko/WWW/hosts/test/public_html/test/', array('baseUrl' => 'http://test/test/'));
     $fsw->filter = array('excludeHidden' => true);
     $fsw->sort = array('directoriesFirst' => true);
     if ($fsw) {
         echo CHtml::beginForm('', 'post', array('enctype' => 'multipart/form-data'));
         echo CHtml::fileField('file');
         echo CHtml::submitButton();
         echo CHtml::endForm();
         if (CUploadedFile::getInstanceByName('file')) {
             echo $fsw->uploadFile('/', 'file', true, 'upload.jpg');
         }
         //echo $fsw->delete('/mydir.txt');
         //print_r ($fsw->createFile('/', 'mydir.txt', 'sdfsdfsвавів'));
         print_r($fsw->getDirectory($path));
     }
 }
开发者ID:rosko,项目名称:Tempo-CMS,代码行数:18,代码来源:TestController.php


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