本文整理汇总了PHP中FormHelper::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHelper::submit方法的具体用法?PHP FormHelper::submit怎么用?PHP FormHelper::submit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHelper
的用法示例。
在下文中一共展示了FormHelper::submit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submit
public function submit($caption = null, $options = array())
{
$defaults = array('class' => 'btn', 'escape' => false);
$options = array_merge($defaults, $options);
list($caption, $options) = $this->_bootstrapGenerate($caption, $options);
return parent::submit($caption, $options);
}
示例2: end
public function end($string = 'Salvar', $options = array())
{
$optionsDefault = array('class' => 'btn btn-primary', 'div' => 'form-group');
$options = array_merge_recursive($optionsDefault, $options);
$retorno = parent::submit($string, $options);
$retorno .= parent::end();
return $retorno;
}
示例3: tweet
/**
* create tweet box
*
* @param $fieldName
* @param $options
* type: element type (default: textarea)
* maxLength: text max length (default: 140)
* counterText: length message
* submit: submit button message. if set to false, not create.
* jqueryCharCount: path to charCount.js (jquery plugin)
* other keys set to input element options.
*/
public function tweet($fieldName, $options = array())
{
$this->setEntity($fieldName);
$domId = !empty($options['id']) ? $options['id'] : $this->domId($fieldName);
$default = array('type' => 'textarea', 'maxlength' => 140, 'jqueryCharCount' => '/twitter_kit/js/charCount.js', 'counterText' => __d('twitter_kit', 'Characters left: ', true), 'submit' => __d('twitter_kit', 'Tweet', true));
$options = am($default, $options);
$inputOptions = $options;
unset($inputOptions['jqueryCharCount']);
unset($inputOptions['counterText']);
unset($inputOptions['submit']);
$out = $this->Html->script($options['jqueryCharCount']);
$out .= $this->Form->input($fieldName, $inputOptions);
$out .= $this->Js->buffer("\n \$('#{$domId}').charCount({\n limit: {$options['maxlength']},\n counterText: '{$options['counterText']}',\n exceeded: function(element) {\n \$('#{$domId}Submit').attr('disabled', true);\n },\n allowed: function(element) {\n \$('#{$domId}Submit').removeAttr('disabled');\n }\n });\n ");
if ($options['submit']) {
$out .= $this->Form->submit($options['submit'], array('id' => $domId . 'Submit'));
}
return $this->output($out);
}
示例4: submit
public function submit($caption = null, $options = array())
{
$defaultOptions = array('class' => 'btn btn-primary', 'div' => 'form-group', 'data-style' => 'expand-right', 'before' => '<div class="col-lg-offset-2 col-lg-10">', 'after' => '</div>');
if (isset($options['bootstrap']) && $options['bootstrap'] == false) {
$defaultOptions = array('class' => 'btn btn-primary');
unset($options['bootstrap']);
}
if (!isset($options['bootstrap'])) {
if (isset($options['confirm'])) {
$options['onclick'] = 'confirmSubmitForm($(this), \'' . $options['confirm'] . '\'); return false;';
}
unset($options['confirm']);
}
$options = array_merge($defaultOptions, $options);
$options['class'] .= ' ladda-button';
return parent::submit($caption, $options);
}
示例5: testSubmit
public function testSubmit()
{
$html = $this->object->submit('element', 'value', array('class' => 'test-class-1', 'arbitrary' => 'arbitrary'), 'test-class-2');
$this->assertAttributes($html, array('class' => array('test-class-1', 'test-class-2', 'ccm-input-submit'), 'value' => 'value'));
}
示例6: submit
public function submit($value = 'Save', $options = array())
{
$defaults = array('class' => 'btn btn-primary');
$options = Set::merge($defaults, $options);
return parent::submit($value, $options);
}
示例7: submit
/**
* Creates a submit button element. This method will generate `<input />` elements that
* can be used to submit, and reset forms by using $options. image submits can be created by supplying an
* image path for $caption.
*
* ### Options
*
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
* FormHelper::input().
* - `before` - Content to include before the input.
* - `after` - Content to include after the input.
* - `type` - Set to 'reset' for reset inputs. Defaults to 'submit'
* - Other attributes will be assigned to the input element.
*
* ### Options
*
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
* FormHelper::input().
* - Other attributes will be assigned to the input element.
*
* @param string $caption The label appearing on the button OR if string contains :// or the
* extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
* exists, AND the first character is /, image is relative to webroot,
* OR if the first character is not /, image is relative to webroot/img.
* @param array $options Array of options. See above.
* @return string A HTML submit button
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::submit
*/
public function submit($caption = null, $options = array())
{
// CUSTOMIZE ADD 2016/06/08 ryuring
// >>>
/*** beforeInput ***/
$event = $this->dispatchEvent('beforeSubmit', array('id' => $this->__id, 'caption' => $caption, 'options' => $options), array('class' => 'Form', 'plugin' => ''));
if ($event !== false) {
$options = $event->result === null || $event->result === true ? $event->data['options'] : $event->result;
}
$output = parent::submit($caption, $options);
/*** afterInput ***/
$event = $this->dispatchEvent('afterSubmit', array('id' => $this->__id, 'caption' => $caption, 'out' => $output), array('class' => 'Form', 'plugin' => ''));
if ($event !== false) {
$output = $event->result === null || $event->result === true ? $event->data['out'] : $event->result;
}
return $output;
// <<<
}
示例8: submit
/**
* @example of use
* echo $appForm->end();
* @example of output
* </table>
* </form>
*
*/
function submit($caption = null, $options = array())
{
$defaults = array('appBefore' => null, 'appAfter' => null);
$options = array_merge($defaults, $options);
$before = $options['appBefore'];
$after = $options['appAfter'];
unset($options['appBefore'], $options['appAfter']);
$out = "<tr><th> </th><td class='vtop'>\n";
$out .= $before . parent::submit($caption, $options) . $after;
$out .= "</td></tr>\n";
return $out;
}
示例9: submit
/**
* Submit button
*
* @param string $label
*
* @return string
*/
public function submit($label = null, $options = array())
{
$defaults = array('div' => 'actions', 'class' => 'btn btn-primary');
$options = array_merge($defaults, $options);
return parent::submit($label, $options);
}
示例10: array
<h2>Editar cliente</h2>
<?php
$id = Request::value('ident');
global $db;
$c = $db->query("select * from cliente where id=" . $id, true);
FormHelper::create('formCliente', '/' . APP_DIR . 'cliente/endereco');
FormHelper::input('nome', 'Nome <strong>*</strong>', $c['nome'], array('placeholder' => 'Digite o nome do cliente'));
FormHelper::input('documento', "Documento (CPF/CNPJ) <strong>*</strong>", $c['documento'], array('placeholder' => 'Digite o documento', 'onkeyup' => 'App.Util.FormatarDocumento(this)'));
FormHelper::input('site', "Site <strong>*</strong>", $c['site'], array('placeholder' => 'www.site.com'));
?>
<input type="hidden" id="ident" name="ident" value="<?php
echo $c['id'];
?>
"/>
<div class="well-sm alert-danger hide">
Há problemas no formulário
</div>
<?php
FormHelper::submit('formClienteSubmit', "Adicionar endereços <span class='glyphicon glyphicon-chevron-right'></span> ", array('class' => 'btn-primary btn-lg', 'onclick' => 'App.Cliente.Submit()', 'type' => 'button'));
示例11: submit
/**
* See FormHelper::submit
*/
function submit($name, $options = array())
{
return parent::submit($name, $options) . "\n";
}
示例12: submit
/**
* Submit
*
* @param string $name
* @param array $settings
* @return string
* @access public
* @since 1.0
*/
public function submit($name = null, $settings = array())
{
$caption = $name;
$options = $settings;
if (!$this->_hasComponent()) {
return '';
}
return parent::submit($caption, $options);
}
示例13: search
function search()
{
return parent::submit('Search', array('class' => 'submit tiny'));
}
示例14: submit
public function submit($title = null, $options = [])
{
$title = $this->generateButtonTitle($title, $options);
unset($options['ga_icon'], $options['ga_icon_after']);
if (!isset($options['div'])) {
$options['div'] = false;
}
$options = $this->addButtonClasses($options);
return parent::submit($title, $options);
}
示例15: submit
/**
* Creates a submit button element. This method will generate `<input />` elements that
* can be used to submit, and reset forms by using $options. image submits can be created by supplying an
* image path for $caption.
*
* ### Options
*
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
* FormHelper::input().
* - `before` - Content to include before the input.
* - `after` - Content to include after the input.
* - `type` - Set to 'reset' for reset inputs. Defaults to 'submit'
* - Other attributes will be assigned to the input element.
*
* ### Options
*
* - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to
* FormHelper::input().
* - Other attributes will be assigned to the input element.
*
* @param string $caption The label appearing on the button OR if string contains :// or the
* extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
* exists, AND the first character is /, image is relative to webroot,
* OR if the first character is not /, image is relative to webroot/img.
* @param array $options Array of options. See above.
* @return string A HTML submit button
*/
public function submit($caption = null, $options = array())
{
if ($this->cherry !== false) {
if (!isset($options['class'])) {
$options['class'] = 'btn btn-default';
}
if (!isset($options['div'])) {
$options['div'] = 'form-group submit';
}
if ((!isset($options['div']) || $options['div']) && !isset($options['before']) && !isset($options['between']) && !isset($options['after']) && $this->cherry === 'form-horizontal') {
$options['before'] = '<div class="col-md-offset-' . $this->labelCol . ' col-md-' . $this->inputCol . '">';
$options['after'] = '</div>';
}
}
return parent::submit($caption, $options);
}