本文整理汇总了PHP中Form::button方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::button方法的具体用法?PHP Form::button怎么用?PHP Form::button使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::button方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
/**
* Process datatables ajax request.
*
* @return \Illuminate\Http\JsonResponse
*/
public function search()
{
$auth_account = $this->auth_user->account;
//return all accounts when we are in the system account
//in a normal account only show the current linked one
if ($auth_account->isSystemAccount()) {
$accounts = Account::all();
} else {
// retrieve the account as a collection
$accounts = Account::where('id', '=', $auth_account->id)->get();
}
return Datatables::of($accounts)->addColumn('actions', function ($account) {
$actions = \Form::open(['route' => ['admin.accounts.destroy', $account->id], 'method' => 'DELETE', 'class' => 'form-inline']);
$actions .= ' <a href="accounts/' . $account->id . '" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-eye-open"></span> ' . trans('misc.button.show') . '</a> ';
$actions .= ' <a href="accounts/' . $account->id . '/edit" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-edit"></span> ' . trans('misc.button.edit') . '</a> ';
if ($account->disabled) {
$actions .= ' <a href="accounts/' . $account->id . '/enable' . '" class="btn btn-xs btn-success"><span class="glyphicon glyphicon-ok-circle"></span> ' . trans('misc.button.enable') . '</a> ';
} else {
$actions .= ' <a href="accounts/' . $account->id . '/disable' . '" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-ban-circle"></span> ' . trans('misc.button.disable') . '</a> ';
}
$actions .= \Form::button('<i class="glyphicon glyphicon-remove"></i> ' . trans('misc.button.delete'), ['type' => 'submit', 'class' => 'btn btn-danger btn-xs']);
$actions .= \Form::close();
return $actions;
})->make(true);
}
示例2: do_private_post
function do_private_post($content, $results)
{
global $config, $speak;
$results = Mecha::O($results);
$results = $config->is->post ? Get::postHeader($results->path, POST . DS . $config->page_type, '/', $config->page_type . ':') : false;
if ($results === false) {
return $speak->plugin_private_post->description;
}
$s = isset($results->fields->pass) ? $results->fields->pass : "";
if (strpos($s, ':') !== false) {
$s = explode(':', $s, 2);
if (isset($s[1])) {
$speak->plugin_private_post->hint = ltrim($s[1]);
}
// override password hint
$s = $s[0];
}
$hash = md5($s . PRIVATE_POST_SALT);
$html = Notify::read(false) . '<div class="overlay--' . File::B(__DIR__) . '"></div><form class="form--' . File::B(__DIR__) . '" action="' . $config->url . '/' . File::B(__DIR__) . '/do:access" method="post">' . NL;
$html .= TAB . Form::hidden('token', Guardian::token()) . NL;
$html .= TAB . Form::hidden('_', $hash) . NL;
$html .= TAB . Form::hidden('kick', $config->url_current) . NL;
$html .= TAB . '<p>' . $speak->plugin_private_post->hint . '</p>' . NL;
$html .= TAB . '<p>' . Form::text('access', "", $speak->password . '…', array('autocomplete' => 'off')) . ' ' . Form::button($speak->submit, null, 'submit') . '</p>' . NL;
$html .= '</form>' . O_END;
if ($results && isset($results->fields->pass) && trim($results->fields->pass) !== "") {
if (!Guardian::happy() && Session::get('is_allow_post_access') !== $hash) {
return $html;
}
}
return $content;
}
示例3: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->tag->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::input('description', $this->tag->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例4: delete_form
function delete_form($request, $routeParams, $id, $modal, $url, $label = "Delete", $class = "btn btn-danger")
{
$form = Form::model($request, ['method' => 'DELETE', 'id' => 'formDelete', 'action' => [$routeParams, $id]]);
$form .= Form::button('<i class="fa fa-trash fa-lg"></i> بلی', ['type' => 'submit', 'data-target' => "#{$modal}", 'data-url' => "{$url}", 'class' => "{$class} delete ", 'id' => 'btnDelete', 'data-id' => $id]);
$form .= Form::close();
return $form;
}
示例5: button_wrap
/**
* Creates a button form input.
*
* @param string $name input name
* @param string $body input value
* @param array $attributes html attributes
*
* @param string $label
* @param string|array $error
* @param string|array $tip
* @return string
*/
public static function button_wrap($name, $body, array $attributes = null, $label = null, $error = null, $tip = null)
{
$body = is_array($body) ? Arr::get($body, $name) : $body;
$attributes = (array) $attributes + array('id' => self::input_id($name, 'button-'));
$input = Form::button($name, $body, $attributes);
return Form::wrap($input, $name, $label, $error, $tip);
}
示例6: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
if (self::$_request_type == Controller::REQUEST_AJAX) {
$cancel_attributes = array('class' => 'ajaxify');
} else {
$cancel_attributes = null;
}
echo Form::open($this->action, array('enctype' => 'multipart/form-data'));
?>
<fieldset>
<?php
echo Form::file('file');
?>
</fieldset>
<fieldset>
<?php
echo Form::csrf();
?>
<?php
echo Form::button('save', '<i class="icon-upload icon-white"></i> ' . __('Upload'), array('type' => 'submit', 'class' => 'btn btn-primary btn-small'));
?>
<?php
echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), $cancel_attributes) : '';
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例7: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
$tags = $this->group->tags();
if (empty($tags)) {
?>
<div class="empty">
<?php
echo __('No tags yet.');
?>
</div>
<?php
} else {
?>
<ul>
<?php
foreach ($tags as $tag) {
?>
<li><?php
echo HTML::anchor(Route::model($tag), $tag->name);
?>
</li>
<?php
}
?>
</ul>
<?php
}
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->group->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::input('description', $this->group->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例8: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->blog_entry->name, array('class' => 'input-xxlarge')), array('name' => __('Title')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::textarea_editor('content', $this->blog_entry->content, array('class' => 'input-xxlarge'), true), array('content' => __('Content')), Arr::get($this->errors, 'content'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::csrf();
?>
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例9: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo $this->message;
echo Form::open();
echo Form::input_wrap('email', $this->email, array('type' => 'email', 'required', 'class' => 'input-lg', 'placeholder' => __('Username or email')), __('Send a new password to'), null, __('We will send you a "new" password generated from the hash of your current, forgotten password.') . '<br><em>' . __('Please change your password after signing in!') . '</em>');
echo Form::button(null, '<i class="fa fa-envelope"></i> ' . __('Send'), array('class' => 'btn btn-primary'));
echo Form::close();
?>
<hr />
<blockquote cite="http://dilbert.com/strips/comic/1996-09-05/">
<dl class="dl-horizontal">
<dt>Asok:</dt> <dd>I have forgotten my password. I humbly beg for assistance.</dd>
<dt>Dogbert:</dt> <dd>I have no time for boring administrative tasks, you fool! I'm too busy upgrading the network.</dd>
<dt>Asok:</dt> <dd>You could have given me a new password in the time it took to belittle me.</dd>
<dt>Dogbert:</dt> <dd>Yeah, but which option would give me job satisfaction?</dd>
</dl>
<small class="pull-right"><a href="http://dilbert.com/strips/comic/1996-09-05/">Dilbert</a></small>
</blockquote>
<?php
return ob_get_clean();
}
示例10: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo Form::open();
?>
<fieldset>
<?php
echo Form::input_wrap('name', $this->blog_entry->name, array('class' => 'input-lg', 'placeholder' => __('Title')), null, Arr::get($this->errors, 'name'));
?>
<?php
echo Form::textarea_wrap('content', $this->blog_entry->content, array('class' => 'input-lg', 'placeholder' => __('Content')), true, null, Arr::get($this->errors, 'content'), null, true);
?>
</fieldset>
<fieldset>
<?php
echo Form::csrf();
?>
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg'));
?>
<?php
echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例11: process
public function process($only_fields = FALSE)
{
$this->_fields_required['id'] = $this->_pos_data['id'];
if (empty($this->_fields['URL'])) {
$this->_fields['URL'] = url::site($this->action_return());
}
foreach ($this->_fields_required as $field) {
if (empty($field)) {
return FALSE;
}
}
$fields = array_merge($this->_fields_required, $this->_fields);
$form = '';
if (!$only_fields) {
$form .= Form::open(self::PAYMENT_URL, array('method' => 'post', 'name' => 'dotpay'));
}
foreach ($fields as $key => $value) {
if (!empty($value)) {
$form .= Form::hidden($key, $value);
}
}
if (!$only_fields) {
$form .= Form::button('platnosci', __("Przejdź do Dotpay.pl"), array('type' => 'submit'));
$form .= Form::close();
$form .= '<script type="text/javascript">document.dotpay.submit();</script>';
}
return $form;
}
示例12: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
$gallery = $this->image->gallery();
echo Form::open(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => 'report')), array('class' => Request::current()->is_ajax() ? 'ajaxify' : ''));
?>
<fieldset>
<?php
echo Form::control_group(Form::input('reason', null, array('class' => 'input-block-level')), array('name' => __('Reason')), null, __('You can enter an optional reason for reporting this image, e.g. why it should be removed'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Report'), array('type' => 'submit', 'class' => 'btn btn-danger btn-large'));
?>
<?php
echo Request::current()->is_ajax() ? '' : HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => '')), __('Cancel'), array('class' => 'cancel'));
?>
<?php
echo Form::csrf();
?>
</fieldset>
<?php
return ob_get_clean();
}
示例13: displayForm
public static function displayForm($value, &$settings, $model)
{
$settings = static::settings($settings);
if (!is_array($value)) {
$value = array();
}
// Search input or
$searchInput = \Form::input($settings['mapping']['fieldName'] . '[search]', null, array('class' => 'input input-xxlarge search-input', 'placeholder' => \Lang::get('admin.common.map_search_placeholder')));
$searchButton = \Form::button('mapsearch', \Lang::get('admin.verbs.search'), array('class' => 'btn btn-primary'));
$searchInput = html_tag('div', array('class' => 'form form-inline search-form'), $searchInput . $searchButton);
// Hidden inputs
$latInput = \Form::hidden($settings['mapping']['fieldName'] . '[lat]', \Arr::get($value, 'lat'), array('class' => 'lat'));
$lngInput = \Form::hidden($settings['mapping']['fieldName'] . '[lng]', \Arr::get($value, 'lng'), array('class' => 'lng'));
$zoomInput = \Form::hidden($settings['mapping']['fieldName'] . '[zoom]', \Arr::get($value, 'zoom'), array('class' => 'zoom'));
// Other elements
$required = isset($settings['required']) ? $settings['required'] : false;
$label_text = $settings['title'] . ($required ? ' *' : '');
$label = \Form::label($label_text);
$mapDiv = html_tag('div', array('class' => 'map', 'id' => \Inflector::friendly_title($settings['mapping']['fieldName'], '-', true) . '-bing-map'), ' ');
// Check that we have an API key
if (empty($settings['api_key'])) {
$content = $label . '<div class="well"><p>' . \Lang::get('admin.bing.api_key_not_set') . '</p></div>';
} else {
$content = $label . $searchInput . $latInput . $lngInput . $zoomInput . $mapDiv;
}
$content = html_tag('div', array('class' => 'controls control-group field-type-bing-map', 'data-field-name' => $settings['mapping']['fieldName']), $content);
return array('content' => $content, 'js_data' => $settings);
}
示例14: process
public function process($only_fields = FALSE)
{
if (empty($this->_fields_required['pos_id']) && empty($this->_fields_required['pos_auth_key'])) {
$this->_set_active_pos();
}
foreach ($this->_fields_required as $field) {
if (empty($field)) {
return FALSE;
}
}
$this->_fields['ts'] = time();
$fields = array_merge($this->_fields_required, $this->_fields);
$data = array('pos_id' => $fields['pos_id'], 'pay_type' => $fields['pay_type'], 'session_id' => $fields['session_id'], 'pos_auth_key' => $fields['pos_auth_key'], 'amount' => $fields['amount'], 'desc' => $fields['desc'], 'desc2' => $fields['desc2'], 'order_id' => $fields['order_id'], 'first_name' => $fields['first_name'], 'last_name' => $fields['last_name'], 'payback_login' => $fields['payback_login'], 'street' => $fields['street'], 'street_hn' => $fields['street_hn'], 'street_an' => $fields['street_an'], 'city' => $fields['city'], 'post_code' => $fields['post_code'], 'country' => $fields['country'], 'email' => $fields['email'], 'phone' => $fields['phone'], 'language' => $fields['language'], 'client_ip' => $fields['client_ip'], 'ts' => $fields['ts'], 'key' => $this->_pos_data['key']);
$fields['sig'] = $this->_get_sig($data);
unset($fields['key']);
if (!$only_fields) {
$form = Form::open(self::PAYMENT_URL . $this->_codepage . '/' . self::PAYMENT_NEW, array('method' => 'post', 'name' => 'platnoscipl'));
}
foreach ($fields as $key => $value) {
if (!empty($value)) {
$form .= Form::hidden($key, $value);
}
}
if (!$only_fields) {
$form .= Form::button('platnosci', __("Przejdź do Płatności.pl"), array('type' => 'submit'));
$form .= Form::close();
$form .= '<script type="text/javascript">document.platnoscipl.submit();</script>';
}
return $form;
}
示例15: recurse_pages
function recurse_pages($pages, $spaces = 0, $layoutsBlocks = [], $pageWidgets = [], $pagesWidgets = [])
{
$data = '';
foreach ($pages as $page) {
// Блок
$currentBlock = array_get($pageWidgets, $page['id'] . '.0');
$currentPosition = array_get($pageWidgets, $page['id'] . '.1');
$data .= '<tr data-id="' . $page['id'] . '" data-parent-id="' . $page['parent_id'] . '">';
$data .= '<td>';
if (!empty($page['childs'])) {
$data .= '<div class="input-group">';
}
$data .= Form::select('blocks[' . $page['id'] . '][block]', [], $currentBlock, ['class' => 'widget-blocks form-control', 'data-layout' => $page['layout_file'], 'data-value' => $currentBlock]);
if (!empty($page['childs'])) {
$data .= "<div class=\"input-group-btn\">" . Form::button(NULL, ['data-icon' => 'level-down', 'class' => 'set_to_inner_pages btn btn-warning', 'title' => trans('widgets::core.button.select_childs')]) . '</div></div>';
}
$data .= '</td><td>';
$data .= Form::text('blocks[' . $page['id'] . '][position]', (int) $currentPosition, ['maxlength' => 4, 'size' => 4, 'class' => 'form-control text-right widget-position']);
$data .= '</td><td></td>';
if (acl_check('page::edit')) {
$data .= '<th>' . str_repeat("- ", $spaces) . link_to_route('backend.page.edit', $page['title'], [$page['id']]) . '</th>';
} else {
$data .= '<th>' . str_repeat("- ", $spaces) . $page['title'] . '</th>';
}
$data .= '</tr>';
if (!empty($page['childs'])) {
$data .= recurse_pages($page['childs'], $spaces + 5, $layoutsBlocks, $pageWidgets, $pagesWidgets);
}
}
return $data;
}