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


PHP TableBuilder::setTableResponse方法代码示例

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


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

示例1: handle

 /**
  * Handle the command.
  *
  * @param  Request         $request
  * @param  ResponseFactory $response
  * @throws \Exception
  */
 public function handle(Request $request, ResponseFactory $response)
 {
     if ($this->builder instanceof MultipleTableBuilder) {
         return;
     }
     $this->dispatch(new ExecuteAction($this->builder));
     if (!$this->builder->getTableResponse()) {
         $this->builder->setTableResponse($response->redirectTo($request->fullUrl()));
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:17,代码来源:PostTable.php

示例2: handle

 /**
  * Save the order of the entries.
  *
  * @param SectionCollection $sections
  * @param TableBuilder      $builder
  * @param array             $selected
  */
 public function handle(SectionCollection $sections, Redirector $redirector, TableBuilder $builder, array $selected)
 {
     $prefix = $builder->getTableOption('prefix');
     $edit = array_shift($selected);
     $ids = implode(',', $selected);
     if ($section = $sections->active()) {
         $builder->setTableResponse($redirector->to($section->getHref('edit/' . $edit . '?' . $prefix . 'edit_next=' . $ids)));
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:16,代码来源:Edit.php

示例3: handle

 /**
  * ExportAll the selected entries.
  *
  * @param TableBuilder    $builder
  * @param ResponseFactory $response
  * @param array           $selected
  */
 public function handle(TableBuilder $builder, ResponseFactory $response, array $selected)
 {
     $model = $builder->getTableModel();
     $stream = $builder->getTableStream();
     $headers = ['Content-Disposition' => 'attachment; filename=' . $stream->getSlug() . '.csv', 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', 'Content-type' => 'text/csv', 'Pragma' => 'public', 'Expires' => '0'];
     $callback = function () use($selected, $model) {
         $output = fopen('php://output', 'w');
         /* @var EloquentModel $entry */
         foreach ($model->all() as $k => $entry) {
             if ($k == 0) {
                 fputcsv($output, array_keys($entry->toArray()));
             }
             fputcsv($output, $entry->toArray());
         }
         fclose($output);
     };
     $builder->setTableResponse($response->stream($callback, 200, $headers));
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:25,代码来源:ExportAll.php


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