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


PHP html::submit方法代码示例

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


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

示例1: sign_up_sign_in

 public static function sign_up_sign_in($url)
 {
     // TODO: add sign in as guest.
     $dropdown_content = array('class' => 'dropdown-menu', 'style' => 'padding: 15px; padding-bottom: 0px;');
     $form = array('method' => 'post', 'action' => $url, 'accept-charset' => 'UTF-8');
     $username = array('type' => 'text', 'placeholder' => 'Username', 'id' => 'username', 'name' => 'username');
     $password = array('type' => 'password', 'placeholder' => 'Password', 'id' => 'password', 'name' => 'password');
     $submit = array('value' => 'Sign In', 'class' => 'btn btn-primary btn-block', 'id' => 'sign-in');
     return html::ul('nav pull-right', html::li(html::a(new moodle_url('/login/signup.php'), 'Sign Up')) . bootstrap::list_divider() . bootstrap::dropdown('Sign In', html::div($dropdown_content, html::form($form, html::input($username) . html::input($password) . html::checkbox('rememberusername', 'Remember username') . html::submit($submit)))));
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:10,代码来源:bootsnipp.php

示例2: array

<?php

echo html::formStart('bestSelldWidg' . $this->post->ID, array('attrs' => 'onsubmit="toeAddToCart(this, \'\', true); return false;"', 'method' => 'POST'));
?>
	<?php 
//echo html::text('qty', array('value' => 1))
?>
	<?php 
echo html::hidden('addQty', array('value' => 1));
?>
	<?php 
echo html::hidden('mod', array('value' => 'user'));
?>
	<?php 
echo html::hidden('action', array('value' => 'addToCart'));
?>
	<?php 
echo html::hidden('pid', array('value' => $this->post->ID));
?>
	<?php 
echo html::hidden('reqType', array('value' => 'ajax'));
?>
	<?php 
echo html::submit('add', array('value' => lang::_('Add')));
?>
	<div class="toeAddToCartMsg"></div>
<?php 
echo html::formEnd();
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:28,代码来源:addToCartBtn.php

示例3: test_submit

 /**
  * @dataProvider submits
  */
 public function test_submit($attributes, $expected)
 {
     $actual = html::submit($attributes);
     $this->assertSame($expected, $actual);
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:8,代码来源:html_test.php

示例4: web_install_user_form

/**
 * function that displays user add form
 */
function web_install_user_form()
{
    $form = new html();
    $form->formStart();
    $form->init(null, 'submit');
    $form->legend('Add User');
    $form->label('email', 'Enter email of user:');
    $form->text('email');
    $form->label('pass1', 'Enter password');
    $form->password('pass1');
    $form->label('pass2', 'Retype password');
    $form->password('pass2');
    $form->submit('submit', 'Submit');
    $form->formEnd();
    echo $form->getStr();
}
开发者ID:gpawlik,项目名称:suited-php-classes,代码行数:19,代码来源:common.php

示例5: render_single_select

 protected function render_single_select(single_select $select)
 {
     $select = clone $select;
     if (empty($select->formid)) {
         $select->formid = html_writer::random_id('single_select_f');
     }
     $params = $select->url->params();
     if ($select->method === 'post') {
         $params['sesskey'] = sesskey();
     }
     $output = html::hidden_inputs($params);
     if (empty($select->attributes['id'])) {
         $select->attributes['id'] = html_writer::random_id('single_select');
     }
     if ($select->disabled) {
         $select->attributes['disabled'] = 'disabled';
     }
     if ($select->tooltip) {
         $select->attributes['title'] = $select->tooltip;
     }
     if ($select->label) {
         $attributes = $select->labelattributes;
         $attributes['for'] = $select->attributes['id'];
         $output .= html::label($attributes, $select->label);
     }
     if ($select->helpicon instanceof help_icon) {
         $output .= $this->render($select->helpicon);
     } else {
         if ($select->helpicon instanceof old_help_icon) {
             $output .= $this->render($select->helpicon);
         }
     }
     $output .= html_writer::select($select->options, $select->name, $select->selected, $select->nothing, $select->attributes);
     $go = html::submit(get_string('go'));
     $output .= '<noscript>' . html::div(array('style' => 'inline'), $go) . '</noscript>';
     $nothing = empty($select->nothing) ? false : key($select->nothing);
     $this->page->requires->js_init_call('M.util.init_select_autosubmit', array($select->formid, $select->attributes['id'], $nothing));
     $output = html::div($output);
     if ($select->method === 'get') {
         $url = $select->url->out_omit_querystring(true);
         // url without params, the anchor part allowed
     } else {
         $url = $select->url->out_omit_querystring();
         // url without params, the anchor part not allowed
     }
     $form_attributes = array('method' => $select->method, 'class' => 'form-inline', 'action' => $url, 'id' => $select->formid);
     $output = html::form($form_attributes, $output);
     return html::div($select->class, $output);
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:49,代码来源:core_renderer.php

示例6: render_backup_files_viewer

 public function render_backup_files_viewer(backup_files_viewer $viewer)
 {
     $files = $viewer->files;
     $table = new html_table();
     $table->attributes['class'] = 'table table-striped table-hover';
     $table->head = array(get_string('filename', 'backup'), get_string('time'), get_string('size'), get_string('download'), get_string('restore'));
     $table->data = array();
     foreach ($files as $file) {
         if ($file->is_directory()) {
             continue;
         }
         $fileurl = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), null, $file->get_filepath(), $file->get_filename(), true);
         $params = array();
         $params['action'] = 'choosebackupfile';
         $params['filename'] = $file->get_filename();
         $params['filepath'] = $file->get_filepath();
         $params['component'] = $file->get_component();
         $params['filearea'] = $file->get_filearea();
         $params['filecontextid'] = $file->get_contextid();
         $params['contextid'] = $viewer->currentcontext->id;
         $params['itemid'] = $file->get_itemid();
         $restoreurl = new moodle_url('/backup/restorefile.php', $params);
         $table->data[] = array($file->get_filename(), userdate($file->get_timemodified()), display_size($file->get_filesize()), html_writer::link($fileurl, get_string('download')), html_writer::link($restoreurl, get_string('restore')));
     }
     $html = html_writer::table($table);
     $html .= html::submit(array('value' => get_string('managefiles', 'backup'), 'class' => 'btn-primary'));
     $url = new moodle_url('/backup/backupfilesedit.php', array('currentcontext' => $viewer->currentcontext->id, 'contextid' => $viewer->filecontext->id, 'filearea' => $viewer->filearea, 'component' => $viewer->component, 'returnurl' => $this->page->url->out()));
     return form::moodle_url($url, $html);
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:29,代码来源:core_backup_renderer.php

示例7: array

                    echo html::hidden('action', array('value' => 'updateCart'));
                    ?>
							<?php 
                    echo html::hidden('mod', array('value' => 'user'));
                    ?>
							<?php 
                    /** @deprecated @see inCartId key, but DO NOT delete this*/
                    ?>
							<?php 
                    echo html::hidden('pid', array('value' => $c['pid']));
                    ?>
							<?php 
                    /*****/
                    ?>
							<?php 
                    echo html::submit('update', array('value' => lang::_('Update'), 'attrs' => 'class="update_qty"'));
                    ?>
							<div id="qty_update_msg_<?php 
                    echo $inCartId;
                    ?>
"></div>
							<?php 
                    echo html::formEnd();
                    ?>
                        <?php 
                } else {
                    if ($this->canEdit && $c['gift']) {
                        //Show this for gifts
                        echo html::formStart('qty_cart', array('action' => '', 'attrs' => 'class="cartQtyUpdate"'));
                        echo html::hidden('inCartId', array('value' => $inCartId));
                        echo html::formEnd();
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:31,代码来源:shoppingCart.php

示例8: action_names

 /**
  * Names action
  */
 public function action_names()
 {
     $input = request::input();
     // legend
     echo self::render_topic('names');
     // code naming conventions
     echo html::a(['name' => 'code']);
     echo '<h3>Naming Conventions: Code</h3>';
     echo object_name_code::explain(null, ['html' => true]);
     // testing form
     echo html::a(['name' => 'code_test']);
     echo '<h3>Test name</h3>';
     if (!empty($input['submit_yes'])) {
         $result = object_name_code::check($input['type'] ?? null, $input['name'] ?? null);
         if (!$result['success']) {
             echo html::message(['options' => $result['error'], 'type' => 'danger']);
         } else {
             echo html::message(['options' => 'Name is good!', 'type' => 'success']);
         }
     }
     $ms = 'Name: ' . html::input(['name' => 'name', 'value' => $input['name'] ?? null]) . ' ';
     $ms .= 'Type: ' . html::select(['name' => 'type', 'options' => object_name_code::$types, 'value' => $input['type'] ?? null]) . ' ';
     $ms .= html::submit(['name' => 'submit_yes']);
     echo html::form(['name' => 'code', 'action' => '#code_test', 'value' => $ms]);
     // database naming convention
     echo '<br/><br/><hr/>';
     echo html::a(['name' => 'db']);
     echo '<h3>Naming Conventions: Database</h3>';
     echo object_name_db::explain(null, ['html' => true]);
     // testing form
     echo html::a(['name' => 'db_test']);
     echo '<h3>Test name</h3>';
     if (!empty($input['submit_yes2'])) {
         $result = object_name_db::check($input['type2'] ?? null, $input['name2'] ?? null);
         if (!$result['success']) {
             echo html::message(['options' => $result['error'], 'type' => 'danger']);
         } else {
             echo html::message(['options' => 'Name is good!', 'type' => 'success']);
         }
     }
     $ms = 'Name: ' . html::input(['name' => 'name2', 'value' => $input['name2'] ?? null]) . ' ';
     $ms .= 'Type: ' . html::select(['name' => 'type2', 'options' => object_name_db::$types, 'value' => $input['type2'] ?? null]) . ' ';
     $ms .= html::submit(['name' => 'submit_yes2']);
     echo html::form(['name' => 'db', 'action' => '#db_test', 'value' => $ms]);
 }
开发者ID:volodymyr-volynets,项目名称:frontend,代码行数:48,代码来源:dev.php

示例9: array

echo html::hidden('addQty', array('value' => 1));
?>
        <?php 
echo html::hidden('mod', array('value' => 'user'));
?>
        <?php 
echo html::hidden('action', array('value' => 'addToCart'));
?>
        <?php 
echo html::hidden('pid', array('value' => $this->post->ID));
?>
        <?php 
echo html::hidden('reqType', array('value' => 'ajax'));
?>
        <?php 
echo html::submit('add', array('value' => lang::_('Thêm vào giỏ')));
?>
        </div>
    <?php 
/*if($this->useFormOnButtonsTpl) { ?>
      </form>
  <?php }*/
?>
    <div class="clear"></div>
    <?php 
if ($this->stockCheck && !$this->availableQty) {
    ?>
        <div class="toeErrorMsg"><?php 
    lang::_e('Please be advised that this product is out of stock');
    ?>
</div>
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:31,代码来源:buttonsBuyAddToCart.php

示例10: actions

 public static function actions($text)
 {
     return html::div('form-actions', html::submit(array('class' => 'btn-primary', 'value' => $text)));
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:4,代码来源:form.php

示例11: array

		</tr>
        <tr>
            <td>
                <?php 
if (!empty($this->toeReturn)) {
    echo html::hidden('toeReturn', array('value' => $this->toeReturn));
}
?>
                <span class="toePasswordForgotLinkBox">
                    <a href="#" class="toeForgotPasswordLink"><?php 
lang::_e('Forgot password?');
?>
</a>
                </span>
                <?php 
echo html::submit('login', array('value' => lang::_('Sign In'), 'attrs' => 'class="tcf_submit" id="toeLoginFormSubmit"'));
?>
                <div id="toeLoginMsg"></div>
            </td>
        </tr>
		
    </table>
<?php 
if (!$this->fieldsOnly) {
    echo html::formEnd();
}
if (!empty($this->registrationLink)) {
    ?>
<div>
    <?php 
    lang::_e('If you have no account - you can');
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:31,代码来源:loginForm.php

示例12: render

 /**
  * Render list
  *
  * @return string
  */
 public final function render()
 {
     $result = '';
     // css & js
     layout::add_css('/numbers/media_submodules/numbers_frontend_html_list_media_css_base.css', 9000);
     layout::add_js('/numbers/media_submodules/numbers_frontend_html_list_media_js_base.js', 9000);
     // load mask
     numbers_frontend_media_libraries_loadmask_base::add();
     // hidden fields
     $result .= html::hidden(['name' => 'offset', 'id' => 'offset', 'value' => $this->offset]);
     $result .= html::hidden(['name' => 'limit', 'id' => 'limit', 'value' => $this->limit]);
     // get total number of rows from count datasource
     if (!empty($this->datasources['count'])) {
         $temp = factory::model($this->datasources['count']['model'])->get($this->datasources['count']['options']);
         $this->total = $temp[0]['count'] ?? 0;
     }
     // get rows
     if (!empty($this->datasources['data'])) {
         $this->rows = factory::model($this->datasources['data']['model'])->get($this->datasources['data']['options']);
         $this->num_rows = count($this->rows);
     }
     // new record
     if (object_controller::can('record_new')) {
         $mvc = application::get('mvc');
         $url = $mvc['controller'] . '/_edit';
         $this->actions['list_new'] = ['value' => 'New', 'sort' => -32000, 'icon' => 'file-o', 'href' => $url];
     }
     // filter
     if (!empty($this->filter)) {
         $this->actions['list_filter'] = ['value' => 'Filter', 'sort' => 1, 'icon' => 'filter', 'onclick' => "numbers.modal.show('list_{$this->list_link}_filter');"];
         $result .= numbers_frontend_html_list_filter::render($this);
     }
     // order by
     $this->actions['list_sort'] = ['value' => 'Sort', 'sort' => 2, 'icon' => 'sort-alpha-asc', 'onclick' => "numbers.modal.show('list_{$this->list_link}_sort');"];
     $result .= numbers_frontend_html_list_sort::render($this);
     // export, before pagination
     if (object_controller::can('list_export')) {
         // add export link to the panel
         $result .= numbers_frontend_html_list_export::render($this);
         $this->actions['list_export'] = ['value' => 'Export/Print', 'sort' => 3, 'icon' => 'print', 'onclick' => "numbers.modal.show('list_{$this->list_link}_export');"];
         // if we are exporting
         if (!empty($this->options['input']['submit_export']) && !empty($this->options['input']['export']['format'])) {
             $result .= numbers_frontend_html_list_export::export($this, $this->options['input']['export']['format']);
             goto finish;
         }
     }
     // refresh
     $this->actions['form_refresh'] = ['value' => 'Refresh', 'sort' => 32000, 'icon' => 'refresh', 'href' => 'javascript:location.reload();', 'internal_action' => true];
     // pagination top
     if (!empty($this->pagination['top'])) {
         $result .= factory::model($this->pagination['top'])->render($this, 'top');
     }
     // data
     $result .= '<hr class="simple"/>';
     if (method_exists($this, 'render_data')) {
         $result .= $this->render_data();
     } else {
         $result .= $this->render_data_default();
     }
     $result .= '<hr class="simple"/>';
     // pagination bottom
     if (!empty($this->pagination['bottom'])) {
         $result .= factory::model($this->pagination['bottom'])->render($this, 'bottom');
     }
     finish:
     $value = '';
     if (!empty($this->actions)) {
         $value .= '<div style="text-align: right;">' . $this->render_actions() . '</div>';
         $value .= '<hr class="simple" />';
     }
     // we add hidden submit element
     $result .= html::submit(['name' => 'submit_hidden', 'value' => 1, 'style' => 'display: none;']);
     // build a form
     $value .= html::form(['name' => "list_{$this->list_link}_form", 'id' => "list_{$this->list_link}_form", 'value' => $result, 'onsubmit' => 'return numbers.frontend_list.on_form_submit(this);']);
     // if we came from ajax we return as json object
     if (!empty($this->options['input']['__ajax'])) {
         $result = ['success' => true, 'html' => $value, 'js' => layout::$onload];
         layout::render_as($result, 'application/json');
     }
     $value = "<div id=\"list_{$this->list_link}_form_mask\"><div id=\"list_{$this->list_link}_form_wrapper\">" . $value . '</div></div>';
     $temp = ['type' => 'primary', 'value' => $value];
     return html::segment($temp);
 }
开发者ID:volodymyr-volynets,项目名称:frontend,代码行数:88,代码来源:base.php


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