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


PHP Button::withValue方法代码示例

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


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

示例1:

                            <?php 
    if ($site->sheet->pilots->where('role', 'Escalator')->count() < 4) {
        echo Modal::named('add_escalator')->withTitle('Add Escalator')->withButton(Button::withValue('Add Escalator')->block())->withBody(view('modals.add_escalator')->with('id', $site->id)->render());
    }
    ?>

                            <?php 
    if ($site->sheet->pilots->where('role', 'Defanger')->count() == 0) {
        echo Modal::named('add_defanger')->withTitle('Add Defanger')->withButton(Button::withValue('Add Defanger')->block())->withBody(view('modals.add_defanger')->with('id', $site->id)->render());
    }
    ?>

                            <?php 
    if ($site->sheet->pilots->where('role', 'Escalator')->count() == 4 && $site->sheet->pilots->where('role', 'Defanger')->count() == 1) {
        echo Modal::named('add_pilots')->withTitle('Add Pilots')->withButton(Button::withValue('Add Pilots')->block())->withBody(view('modals.add_pilots')->with('id', $site->id)->render());
    }
    ?>
                        </div>
                    <?php 
}
?>
                    <?php 
if (!$site->sheet->is_paid && $site->sheet->pilots()->whereNotIn('role', ['Bookmarker', 'Escalator', 'Defanger'])->count() > 0) {
    ?>
                        <div class="jumbotron">
                            <?php 
    if (!$site->finished && $site->active) {
        ?>
                                <div>
                                    <?php 
开发者ID:Necrotex,项目名称:lootsheet,代码行数:30,代码来源:single.php

示例2: withButton

 /**
  * Sets the button
  *
  * @param Button $button The button to open the modal with
  * @return $this
  */
 public function withButton(Button $button = null)
 {
     if ($button) {
         $this->button = $button;
     } else {
         $button = new Button();
         $this->button = $button->withValue('Open Modal');
     }
     return $this;
 }
开发者ID:GhDj,项目名称:erp-fac-fin,代码行数:16,代码来源:Modal.php

示例3: button_to

 /**
  * Generates a form containing a single button that submits to the URL created by the set of options.
  *
  * Based on \Form::open(), \Form::submit() and \Form::close()
  *
  * @param string $name
  * @param array  $options There are a few special options:
  * 'url' - open forms that point to named URL. E.G. ['url' => 'foo/bar']
  * 'route' - open forms that point to named routes. E.G. ['route' => 'route.name']
  * 'action' - open forms that point to controller actions. E.G. ['action' => 'Controller@method']
  * 'method' - HTTP verb. Supported verbs are 'post', 'get', 'delete', 'patch', and 'put'. By default it will be 'post'.
  * 'data-remote' - If set to true, will allow the Unobtrusive JavaScript drivers to control the submit behavior. By default this behavior is an ajax submit.
  * 'data-confirm' - This will use the unobtrusive JavaScript driver to prompt with the question specified. If the user accepts, the link is processed normally, otherwise no action is taken.
  * 'form' - This array will be form attributes
  * 'formClass' - This controls the class of the form within which the submit button will be placed. By default it will be 'button_to'.
  * @return string
  */
 function button_to($name, array $options = [])
 {
     $formOptions = ['method' => array_pull($options, 'method', 'post'), 'class' => array_pull($options, 'formClass', 'button_to')];
     if (array_get($options, 'url')) {
         $formOptions['url'] = array_pull($options, 'url');
     }
     if (array_get($options, 'route')) {
         $formOptions['route'] = array_pull($options, 'route');
     }
     if (array_get($options, 'action')) {
         $formOptions['action'] = array_pull($options, 'action');
     }
     if (array_get($options, 'data-remote')) {
         $formOptions['data-remote'] = array_pull($options, 'data-remote');
     }
     if (array_get($options, 'data-confirm')) {
         $formOptions['data-confirm'] = array_pull($options, 'data-confirm');
     }
     $formOptions = array_merge($formOptions, array_pull($options, 'form', []));
     $submitButton = Form::submit($name, $options);
     if (class_exists('Button') && is_a(new Button(), '\\Illuminate\\Support\\Facades\\Facade') && method_exists(Button::getFacadeRoot(), 'withValue')) {
         $submitButton = Button::withValue($name)->withAttributes($options)->submit();
     }
     return Form::open($formOptions) . '<div>' . $submitButton . '</div>' . Form::close();
 }
开发者ID:efficiently,项目名称:jquery-laravel,代码行数:42,代码来源:helpers.php


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