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


PHP TableBuilder::getActions方法代码示例

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


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

示例1: guess

 /**
  * Guess the action text.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     $stream = $builder->getTableStream();
     if (!($module = $this->modules->active())) {
         return;
     }
     $section = $this->controlPanel->getControlPanelActiveSection();
     foreach ($actions as &$action) {
         /*
          * Nothing to do if set already.
          */
         if (isset($action['permission'])) {
             continue;
         }
         /*
          * Try and guess the permission.
          */
         if ($stream) {
             $action['permission'] = $module->getNamespace($stream->getSlug() . '.' . $action['slug']);
         } elseif ($section) {
             $action['permission'] = $module->getNamespace($section->getSlug() . '.' . $action['slug']);
         }
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:31,代码来源:PermissionGuesser.php

示例2: normalize

 /**
  * Normalize action input.
  *
  * @param TableBuilder $builder
  */
 public function normalize(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     $prefix = $builder->getTableOption('prefix');
     foreach ($actions as $slug => &$action) {
         $action = $this->process($prefix, $slug, $action);
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:14,代码来源:ActionNormalizer.php

示例3: guess

 /**
  * Guess the action handler.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     foreach ($actions as &$action) {
         // Only if it's not already set.
         if (!isset($action['handler'])) {
             if (class_exists($class = $this->guessClass($builder, $action))) {
                 $action['handler'] = $class . '@handle';
             }
         }
     }
     $builder->setActions($actions);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:18,代码来源:HandlerGuesser.php

示例4: guess

 /**
  * Guess the action text.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     if (!($module = $this->modules->active())) {
         return;
     }
     foreach ($actions as &$action) {
         // Only if it's not already set.
         if (!isset($action['text'])) {
             $action['text'] = $module->getNamespace('button.' . $action['slug']);
         }
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:19,代码来源:TextGuesser.php

示例5: merge

 /**
  * Merge in registered parameters.
  *
  * @param TableBuilder $builder
  */
 public function merge(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     foreach ($actions as &$parameters) {
         $action = $original = array_pull($parameters, 'action');
         if ($action && ($action = $this->actions->get($action))) {
             $parameters = array_replace_recursive($action, array_except($parameters, 'action'));
         }
         $button = array_get($parameters, 'button', $original);
         if ($button && ($button = $this->buttons->get($button))) {
             $parameters = array_replace_recursive($button, array_except($parameters, 'button'));
         }
     }
     $builder->setActions($actions);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:20,代码来源:ActionLookup.php

示例6: build

 /**
  * Build dropdown items.
  *
  * @param TableBuilder $builder
  */
 public function build(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     foreach ($actions as $key => &$action) {
         if ($dropdown = array_get($action, 'parent')) {
             foreach ($actions as &$parent) {
                 if (array_get($parent, 'slug') == $dropdown) {
                     if (!isset($parent['dropdown'])) {
                         $parent['dropdown'] = [];
                     }
                     $parent['dropdown'][] = $action;
                 }
             }
         }
     }
     $builder->setActions($actions);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:22,代码来源:ActionDropdown.php

示例7: resolve

 /**
  * Resolve table views.
  *
  * @param TableBuilder $builder
  */
 public function resolve(TableBuilder $builder)
 {
     $this->resolver->resolve($builder->getActions(), compact('builder'));
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:9,代码来源:ActionResolver.php

示例8: parse

 /**
  * Parse the table buttons.
  *
  * @param TableBuilder $builder
  */
 public function parse(TableBuilder $builder)
 {
     $builder->setActions($this->parser->parse($builder->getActions()));
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:9,代码来源:ActionParser.php

示例9: evaluate

 /**
  * Evaluate the table actions.
  *
  * @param TableBuilder $builder
  */
 public function evaluate(TableBuilder $builder)
 {
     $builder->setActions($this->evaluator->evaluate($builder->getActions(), compact('builder')));
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:9,代码来源:ActionEvaluator.php

示例10: predict

 /**
  * Predict the presence of of the sortable action.
  *
  * @param TableBuilder $builder
  */
 public function predict(TableBuilder $builder)
 {
     if ($builder->getTableOption('sortable')) {
         $builder->setActions(array_merge(['reorder'], $builder->getActions()));
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:11,代码来源:SortablePredictor.php


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