本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: resolve
/**
* Resolve table views.
*
* @param TableBuilder $builder
*/
public function resolve(TableBuilder $builder)
{
$this->resolver->resolve($builder->getActions(), compact('builder'));
}
示例8: parse
/**
* Parse the table buttons.
*
* @param TableBuilder $builder
*/
public function parse(TableBuilder $builder)
{
$builder->setActions($this->parser->parse($builder->getActions()));
}
示例9: evaluate
/**
* Evaluate the table actions.
*
* @param TableBuilder $builder
*/
public function evaluate(TableBuilder $builder)
{
$builder->setActions($this->evaluator->evaluate($builder->getActions(), compact('builder')));
}
示例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()));
}
}