@param string|null $route
@param array       $params
@param string      $label
@param string      $title
@param string      $class
@param string      $icon

@return ButtonInterface
490878
public function setActionDelete(
        string $route = null,
        array $params = [],
        string $label = '',
        string $title = 'Deleted',
        string $class = 'btn btn-danger btn-sm flat',
        string $icon = 'fa fa-times'
    ): ButtonInterface {
        $this->setAction(self::TYPE_ACTION_DELETE)
            ->setTypeForm()
            ->setLabel($label)
            ->setTitle($title)
            ->setRoute($route, $params)
            ->setClass($class)
            ->setIcon($icon);

        return $this;
    }
473816
protected function addLinkRoute(ItemInterface $menu, $label, $route, $routeParameters = array())
    {
        $item = $menu->addChild($label, array('route' => $route, 'routeParameters' => $routeParameters, 'routeAbsolute' => UrlGeneratorInterface::ABSOLUTE_PATH));
        $item->setExtra('translation_domain', $this->translation_domain);

        if ($this->isCurrentUri($item->getUri())) {
            $this->setActive($item);
        }

        return $item;
    }
25075
public function add($route, array $args = null, $label = null)
    {
        $this->hierarchy[] = [
            'label' => $label ?: static::titleIze($route),
            'route' => $route,
            'args' => (array) $args
        ];
        $this->lastKey = null;

        return $this;
    }
490210
public static function customButton($title, $url, $attributes = array())
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return null;
        }

        $attributes = Helpers::addClass($attributes, "clef");

        return '<a href="https://clef.io/iframes/qr?app_id='.$config['app_id'].'&amp;redirect_url='.$url.'" '.\HTML::attributes($attributes).'>'.$title.'</a>';
    }
1131511
public static function fromBlueprint(Blueprint $blueprint, $title, array $arguments = [], $type = self::TYPE_MAIN, $fillFromToolbar = 'section') {
        if($title instanceof FieldSet) {
            $title = $arguments['model']->getAttribute($title->getTitleFieldName());
        } else {
            if(!is_string($title)) {
                throw new \InvalidArgumentException('$title must be either a string or an instance of \Oxygen\Core\Form\FieldSet');
            }
        }

        $object = new static(
            $title,
            $arguments,
            $type
        );

        // sets a prefix to all the routes in the toolbar
        $object->getToolbar()->setPrefix($blueprint->getRouteName());

        // fills the toolbar with buttons from the blueprint
        $object->getToolbar()->fillFromBlueprint($blueprint, $fillFromToolbar);

        return $object;
    }
895796
public function setRoute($route, array $params = array())
    {
        $this->route = $route;
        $this->routeParams = $params;

        return $this;
    }
173670
public function make(string $slug, string $title): PageInterface
    {
        $view = (new PageView($this->view))
            ->setTheme('themosis.pages')
            ->setLayout('default')
            ->setView('page');

        $page = new Page($this->action, $this->filter, $view, new PageSettingsRepository(), $this->validator);
        $page->setSlug($slug)
            ->setTitle($title)
            ->setMenu($title);

        // Store page instance within the service container.
        $this->view->getContainer()->instance($this->prefix.'.'.$page->getSlug(), $page);

        return $page;
    }
449647
protected function addChild(ItemInterface $menu, Request $request, $label, $route, $position = null, callable $activeTest = null, $routeParameters = [])
    {
        $menu->addChild($this->createChild($request, $label, $route, $position, $activeTest, $routeParameters))->setExtra('translation_domain', 'tuna_admin');

        return $menu;
    }
821050
public static function resolveForRoute($container, $route)
    {
        $parameters = $route->parameters();

        foreach ($route->signatureParameters(UrlRoutable::class) as $parameter) {
            if (! $parameterName = static::getParameterName($parameter->name, $parameters)) {
                continue;
            }

            $parameterValue = $parameters[$parameterName];

            if ($parameterValue instanceof UrlRoutable) {
                continue;
            }

            $instance = $container->make($parameter->getClass()->name);

            if (! $model = $instance->resolveRouteBinding($parameterValue)) {
                throw (new ModelNotFoundException)->setModel(get_class($instance));
            }

            $route->setParameter($parameterName, $model);
        }
    }
724972
private function _setParamsToRoute($route, $params)
    {
        foreach ($params as $key => $value)
        {
            $route = preg_replace('/\{' . $key . '\}/', $value, $route);
        }

        return $route;
    }
374656
public function button(string $title, $url = false, array $options = []): string
    {
        $options = Hash::merge([
            'icon' => 'arrow-right',
            'class' => 'btn btn-default btn-xs',
            'additionalClasses' => '',
        ], $options);

        $options['class'] .= ' ' . $options['additionalClasses'];
        if ($options['icon']) {
            $title = '<i class="fa fa-' . $options['icon'] . '"></i> ' . $title;
            $options['escape'] = false;
        }
        unset($options['additionalClasses'], $options['icon']);

        return $this->Html->link($title, $url, $options);
    }
165805
public function create(
       string $action,
       string $prefix,
       string $controller,
       array $param,
       string $path): RouteInterface
   {
       try {
           return $this->proto->clone()
               ->setAction($action)
               ->setPrefix($prefix)
               ->setController($controller)
               ->setParam($param)
               ->setPath($path);
       } catch (InvalidArgumentException $e) {
           throw new InvalidArgumentException(
               "Can't create route: " . $e->getMessage());
       }
   }
1365711
public function addButton(string $title = null, array $options = []): string
    {
        if (!$title) {
            $title = __d('ck_tools', 'add');
        }
        $options = Hash::merge([
            'url' => null,
            'icon' => 'fa fa-plus',
            'class' => 'btn btn-default btn-xs btn-add',
        ], $options);
        $url = $options['url'];
        if (!$url) {
            $url = ['action' => 'add'];
            $url = $this->augmentUrlByBackParam($url);
        }
        $icon = $options['icon'];
        unset($options['url'], $options['icon']);
        if ($icon) {
            $title = '<i class="' . $icon . '"></i> ' . '<span class="button-text">' . $title . '</span>';
            $options['escape'] = false;
        }

        return $this->Html->link($title, $url, $options);
    }
1300480
public function addPage(PageInterface $page, $route = null)
    {
        if (!isset($this->instances[$page->path()])) {
            $this->instances[$page->path()] = $page;
        }
        $route = $page->route($route);
        if ($page->parent()) {
            $this->children[$page->parent()->path()][$page->path()] = ['slug' => $page->slug()];
        }
        $this->routes[$route] = $page->path();

        $this->grav->fireEvent('onPageProcessed', new Event(['page' => $page]));
    }
1307550
public function route(string $action, $callback, string $method = 'get', string $title = ''): PageInterface
    {
        $method = strtolower($method);
        $action = $this->parseAction($action, $method);

        $this->routes[$method][$action] = $callback;

        $this->titles[$action] = ! empty($title) ? $title : $this->getTitle();

        $this->registerRouteActions();

        return $this;
    }
692971
public function toRoute($route = null, $params = array(), $query = array())
    {
        if(!$route)
            return $this->refresh();

        $url = $this->urlFactory->create($route, $params, $query);

        return $this->to($url);
    }
1368382
protected function addAction($label, $icon, $route)
    {
        $action = (object)[
            'route' => $route,
            'icon'  => 'fa-' . $icon,
            'text'  => $label,
        ];

        $this->actions->add($action);
    }