本文整理汇总了PHP中form::button方法的典型用法代码示例。如果您正苦于以下问题:PHP form::button方法的具体用法?PHP form::button怎么用?PHP form::button使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form
的用法示例。
在下文中一共展示了form::button方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: button_wrap
/**
* Creates an HTML form button input tag.
*
* @param string|array input name or an array of HTML attributes
* @param string|array input value, when using a name or values
* @param string a string to be attached to the end of the attributes
* @param string $label
* @param string|array $error
* @param string|array $tip
* @return string
*/
public static function button_wrap($data = '', $value = '', $extra = '', $label = '', $error = '', $tip = '')
{
$name = is_array($data) ? arr::get($data, 'name') : $data;
$value = is_array($value) ? arr::get($value, $name) : $value;
$input = form::button($data, $value, $extra);
return form::wrap($input, $name, $label, $error, $tip);
}
示例2: input
function input($key, $data, $inputOnly = false)
{
$input = "<input type='text' name='" . parent::protection($key) . "' value='{$key}' id='qform_input_{$key}' />" . parent::button("{$key}-select-coordinates", 'Nháºp Tá»�a Ä�á»™', 'coordinates') . '<div id="get_map" title="Lấy Tá»�a Ä�á»™ Trên Bản Ä�ồ (kéo thả đến Ä‘iểm cần để lấy tá»�a Ä‘á»™)"></div>';
$script = '' . "var map={" . "getPostion:function(){" . "\$('#dialog:ui-dialog' ).dialog('destroy' );" . "\$('#get_map').dialog({" . "draggable: false,resizable: false,height: 440, width:640,modal: true," . "open: function(event, ui) {" . "jQuery(this).html('<div id=\"gmap\" class=\"gmap3\"></div>');" . 'map.loadMap();' . "}" . "});" . "}," . "loadMap:function(){" . "\$('#gmap').gmap3({\n\t\taction: 'addMarker',\n\t\tlatLng: [21.029391714981056, 105.85231983068843],\n\t\tmap:{ center: true, zoom: 15},\n\t\tmarker:{\n\t\toptions:{ draggable:true },\n\t\tevents:{\n\t\tdragend: function(marker){\n\t\t\$(this).gmap3({\n\t\taction:'getAddress',\n\t\tlatLng:marker.getPosition(),\n\t\tcallback:function(results){\n\t\tvar map = \$(this).gmap3('get'),\n\t\tinfowindow = \$(this).gmap3({action:'get', name:'infowindow'});\n\t\taddressValue = results && results[1] ? results && results[1].formatted_address : 'no address';\n\t\tcontent ='<div class=\"address\">';\n\t\tcontent += addressValue;\n\t\tcontent +='</div>';\n\t\tcontent +='<div class=\"button2-left\" style=\"clear: both;\" ><div class=\"blank\">'\n\t\tcontent +='<input type=\"button\" title=\"\" value=\"Lấy T�a �ộ nà y\" onclick=\"\$(\\'#qform_input_" . $fieldKey . "\\').val(\\''+marker.getPosition().lat()+','+marker.getPosition().lng()+'\\'); \$(\\'#get_map\\' ).dialog(\\'close\\');\" /></div></div>';\n\t\tmap.panTo(marker.getPosition());\n\t\t\t\n\t\t\n\t\tif (infowindow){\n\t\tinfowindow.open(map, marker);\n\t\tinfowindow.setContent(content);\n\t\t} else {\n\t\t\$(this).gmap3({action:'addinfowindow', anchor:marker, options:{content: content}});\n\t\t}\n\t\t\n\t\t}\n\t\t});\n\t\t}\n\t\t}\n\t\t \n\t\t}\n\t\t}\n\t\t);" . "}," . "};";
$input .= '<script type="text/javascript">' . $script . "\$('#{$key}-select-coordinates').click(function(){" . 'map.getPostion();' . '});' . '</script>';
//$this->CI->template->add_js($script);
return self::rowForm($data->title, $input);
}
示例3: render
public function render(&$render_variables, $errors = array())
{
// Load base template and attributes
$result = parent::render($render_variables, $errors);
if (is_array($result) and $result['type'] == 'submit') {
$render_variables['submit'] = TRUE;
}
$result['template']->element = form::button($result['attributes'], $this->value);
// Return the resulting output
return (string) $result['template']->render();
}
示例4: input
public function input($fieldKey, $fieldData)
{
$lable = preg_replace("/<.*?>/", "", $fieldData->lable);
$attribute = '';
if (!isset($fieldData->dir) || $fieldData->dir == '') {
$fieldData->dir = 'content';
}
$resourceURL = $this->CI->config->item('resource_domain');
$directory = $fieldData->dir != '' ? "/" . $fieldData->dir != '' : '';
$subDir = $fieldData->dir != '' ? "?dir={$fieldData->dir}" : '';
$script = '' . 'jQuery("#' . $fieldKey . '-select-image").click(function(e){ ' . "e.preventDefault();" . "var fm = \$('<div/>').dialogelfinder({" . "url : '" . $this->CI->config->item('assets_url') . "/elfinder-2.0/php/connector.php'," . "lang : 'en', width : 840,destroyOnClose : true," . "getFileCallback : function(files, fm) {" . "jQuery('input[type=text][name=" . parent::protection($fieldKey) . "]').val(files.replace('" . $this->CI->config->item('resource_domain') . "/', ''));" . "},commandsOptions : {getfile : { oncomplete : 'close',folders : false}}" . "}).dialogelfinder('instance');" . 'return false;' . '});';
$this->CI->template->add_js_ready($script);
$html = '<input type="text" name="' . parent::protection($fieldKey) . '" value="' . $fieldData->value . '" class="field-image text" readonly />';
$html .= parent::button('select image', 'button', array('id' => "{$fieldKey}-select-image", 'class' => 'imagebutton button grey'));
return $html;
}
示例5: index
public function index()
{
stylesheet::add('switchboard', 50);
javascript::add('pubsub.js', 50);
$this->view->sofia_status = '';
$sipInterface = Doctrine::getTable('SipInterface')->findAll();
foreach ($sipInterface as $interface) {
$this->view->sofia_status .= form::button(array('id' => 'sofia_profile', 'class' => 'eslEvent', 'value' => 'SIP Interface ' . $interface->sipinterface_id . ' Status', 'param' => 'sipinterface_' . $interface->sipinterface_id));
}
$this->view->trunk_status = '';
$trunks = Doctrine::getTable('Trunk')->findAll();
foreach ($trunks as $trunk) {
$this->view->trunk_status .= form::button(array('id' => 'gateway_profile', 'class' => 'eslEvent', 'value' => 'Trunk ' . $trunk->trunk_id . ' Status', 'param' => 'trunk_' . $trunk->trunk_id));
}
//CLEAR THE ESL SESSION
$_SESSION['esl'] = array();
}
示例6: index
public function index()
{
stylesheet::add('esl', 50);
$this->view->sofia_status = '';
$sipInterface = Doctrine::getTable('SipInterface')->findAll();
foreach ($sipInterface as $interface) {
$this->view->sofia_status .= form::button(array('id' => 'sofia_profile', 'class' => 'eslEvent', 'value' => 'SIP Interface ' . $interface->sipinterface_id . ' Status', 'param' => 'sipinterface_' . $interface->sipinterface_id));
}
$this->view->trunk_status = '';
$trunks = Doctrine::getTable('Trunk')->findAll();
foreach ($trunks as $trunk) {
$this->view->trunk_status .= form::button(array('id' => 'gateway_profile', 'class' => 'eslEvent', 'value' => 'Trunk ' . $trunk->trunk_id . ' Status', 'param' => 'trunk_' . $trunk->trunk_id));
}
$eslManager = new EslManager();
$this->view->isConnected = $eslManager->isConnected();
$this->view->isExtension = $eslManager->isExtension();
}
示例7: buildForm
private function buildForm()
{
$options = array('method' => "POST", 'enctype' => "multipart/form-data", 'action' => '/blog/formular/add', 'width' => '400px');
$form = new \form('testing', $options);
$form->label('checkbox');
$form->checkbox('checkbox test', 'testcheckbox', 'check', '');
$form->checkbox('checkbox test2', 'testcheckbox', 'check2', true);
$form->label('radio');
$form->radio('radio test', 'testradio', 'radio', '');
$form->radio('radio test 2', 'testradio', 'radio2', true);
$form->label('textarea');
$form->text('textarea', ' ', ['error' => $this->error['textarea']]);
$form->select('autos', ['a' => 'audi', 'b' => 'vw', 'c' => 'toyota'], 'b', ['label' => 'auto select']);
$form->text('username', '', ['placeholder' => 'username', 'label' => 'Username', 'error' => $this->error['username']]);
$form->password('password', '', ['label' => 'Password', 'error' => $this->error['password']]);
$form->button('senden', ['type' => 'submit']);
return $form;
}
示例8: template_bottom
<?php
echo $form->select_db_multi("Danh mục", "sta_category_id", "sta_category_id", $listAll, "cat_id", "cat_name", $sta_category_id, "Danh mục", 1, "", 1, 0, "", "");
echo $form->text("Tiêu đề", "sta_title", "sta_title", $sta_title, "Tiêu đề", 1, 250, "", 255, "", "", "");
echo $form->text("Thứ tự", "sta_order", "sta_order", $sta_order, "Thứ tự", 2, 50, "", 255, "", "", "");
echo $form->text("Ngày tạo", "sta_strdate" . $form->ec . "sta_strtime", "sta_strdate" . $form->ec . "sta_strtime", $sta_strdate . $form->ec . $sta_strtime, "Ngày (dd/mm/yyyy)" . $form->ec . "Giờ (hh:mm:ss)", 0, 70 . $form->ec . 70, $form->ec, 10 . $form->ec . 10, " - ", $form->ec, " <i>(Ví dụ: dd/mm/yyyy - hh:mm:ss)</i>");
echo $form->close_table();
echo $form->wysiwyg("Mô tả chi tiết", "sta_description", $sta_description, "../../resource/ckeditor/", "95%", 300);
echo $form->create_table();
echo $form->close_table();
echo $form->wysiwyg("Bản lưu", "sta_description1", $sta_description1, "../../resource/ckeditor/", "95%", 300);
echo $form->create_table();
?>
<?php
echo $form->radio("Sau khi lưu dữ liệu", "add_new" . $form->ec . "return_listing" . $form->ec . "return_edit", "after_save_data", $add . $form->ec . $listing . $form->ec . $edit, $after_save_data, "Thêm mới" . $form->ec . "Quay về danh sách" . $form->ec . "Sửa bản ghi", 0, "" . $form->ec . "" . $form->ec . "");
echo $form->button("submit" . $form->ec . "reset", "submit" . $form->ec . "reset", "submit" . $form->ec . "reset", "Cập nhật" . $form->ec . "Làm lại", "Cập nhật" . $form->ec . "Làm lại", 'style="background:url(' . $fs_imagepath . 'button_1.gif) no-repeat; border:none;"' . $form->ec . 'style="background:url(' . $fs_imagepath . 'button_2.gif) no-repeat; border:none;"', "");
?>
<br />
<?php
echo $form->hidden("action", "action", "submitForm", "");
?>
<?
$form->close_table();
$form->close_form();
unset($form);
?>
<? /*------------------------------------------------------------------------------------------------*/ ?>
<?php
echo template_bottom();
?>
示例9:
<dt><label for="password">Password:</label></dt>
<dd><?php
echo form::password('password', $post['password']);
?>
</dd>
</dl>
<dl>
<dd><?php
echo form::checkbox('remember_check', 'rememberMe', TRUE);
?>
<label for="rememberMe" class="rememberMe">Remember me</label></dd>
<?php
if (isset($_GET['return_to'])) {
echo form::hidden("return_to", $_GET['return_to']);
} else {
echo form::hidden("return_to", "home");
}
?>
</dl>
</fieldset>
<fieldset class="action">
<?php
echo form::button('submit', 'Login');
?>
</fieldset>
</form>
</div>
示例10:
if (isset($views)) {
echo subview::render($views);
}
?>
</div>
<div class="buttons form_bottom">
<?php
if (!empty($allowNext)) {
echo form::button(array('name' => 'next', 'class' => 'save small_green_button'), 'Continue');
}
?>
<?php
if (!empty($allowPrev)) {
echo form::button(array('name' => 'prev', 'class' => 'prev small_red_button'), 'Back');
}
?>
</div>
<?php
echo form::close();
?>
</div>
</div>
</div>
<?php
javascript::renderCodeBlocks();
?>
</body>
</html>
示例11: foreach
echo form::open($action, $attributes);
?>
<?php
include Eight::find_file('views', 'eight/form_errors');
?>
<fieldset>
<?php
foreach ($inputs as $title => $input) {
?>
<label><span><?php
echo $title;
?>
</span><?php
echo form::input($input);
?>
</label>
<?php
}
?>
</fieldset>
<fieldset class="submit"><?php
echo html::anchor($cancel, 'Cancel'), ' ', form::button(nil, 'Save');
?>
</fieldset>
<?php
echo form::close();
示例12: render
public function render()
{
$data = $this->data;
unset($data['label']);
return form::button($data);
}
示例13: isset
echo form::input('username', isset($post['username']) ? $post['username'] : NULL, array('id' => 'username'));
?>
</div>
<div class="line" style="width: 160px">
<?php
echo form::label('password', 'Password');
?>
<?php
echo form::password('password', isset($post['password']) ? $post['password'] : NULL, array('id' => 'password'));
?>
</div>
<div class="line">
<?php
echo form::checkbox('remember', 'TRUE', FALSE, array('id' => 'remember', 'class' => 'auto'));
?>
<?php
echo form::label('remember', 'Remember');
?>
</div>
<div class="line controls">
<?php
echo form::button(NULL, 'כניסה למערכת', array('type' => 'submit', 'style' => 'width:110px;'));
?>
</div>
</fieldset>
<?php
echo form::close();
?>
</div>
示例14: getButtonLink
public function getButtonLink($params)
{
$params['name'] = 'submit[' . $params['name'] . ']';
$data = array('name' => 'submit[' . Bluebox_Controller::SUBMIT_CONFIRM . ']', 'class' => 'save small_green_button');
return form::button();
}
示例15: array
<?php
echo form::select('endmonth', $months);
echo form::select('endday', $days);
echo form::select('endyear', $years);
?>
</p>
</div>
</div>
<div class="box_bottom"></div>
</div>
<div class="box">
<div class="box_top"></div>
<div class="box_inner notable">
<h2 class="black">Rules</h2>
<?php
echo form::button('addRule', 'Add Rule', array('id' => 'add_rule', 'class' => 'add_rule'));
?>
<div id="rules"></div>
</div>
<div class="box_bottom"></div>
</div>
<div class="submit_container">
<ul class="buttons">
<li><?php
echo form::submit('submit', '', array('class' => 'submit'));
?>
</li>
</ul>
</div>
<?php
echo form::close();