本文整理汇总了PHP中Anomaly\Streams\Platform\Ui\Table\TableBuilder::getRequestValue方法的典型用法代码示例。如果您正苦于以下问题:PHP TableBuilder::getRequestValue方法的具体用法?PHP TableBuilder::getRequestValue怎么用?PHP TableBuilder::getRequestValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Anomaly\Streams\Platform\Ui\Table\TableBuilder
的用法示例。
在下文中一共展示了TableBuilder::getRequestValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle the command.
*
* @param ModuleCollection $modules
*/
public function handle(ModuleCollection $modules)
{
$table = $this->builder->getTable();
/**
* Set the default sortable option.
*/
if ($table->getOption('sortable') === null) {
$stream = $table->getStream();
if ($stream && $stream->isSortable()) {
$table->setOption('sortable', true);
}
}
/**
* Sortable tables have no pages.
*/
if ($table->getOption('sortable') === true) {
$table->setOption('limit', $table->getOption('limit', 99999));
}
/**
* Set the default breadcrumb.
*/
if ($table->getOption('breadcrumb') === null && ($title = $table->getOption('title'))) {
$table->setOption('breadcrumb', $title);
}
/**
* If the table ordering is currently being overridden
* then set the values from the request on the builder
* last so it actually has an effect.
*/
if ($orderBy = $this->builder->getRequestValue('order_by')) {
$table->setOption('order_by', [$orderBy => $this->builder->getRequestValue('sort', 'asc')]);
}
/**
* If the permission is not set then
* try and automate it.
*/
if ($table->getOption('permission') === null && ($module = $modules->active()) && ($stream = $this->builder->getTableStream())) {
$table->setOption('permission', $module->getNamespace($stream->getSlug() . '.read'));
}
}