Caffeinated\Menus\Builder::dispatch PHP 메소드

dispatch() 공개 메소드

Get the action type from the options.
public dispatch ( array $options ) : string
$options array
리턴 string
    public function dispatch($options)
    {
        if (isset($options['url'])) {
            return $this->getUrl($options);
        } elseif (isset($options['route'])) {
            return $this->getRoute($options['route']);
        } elseif (isset($options['action'])) {
            return $this->getAction($options['action']);
        }
        return null;
    }

Usage Example

예제 #1
0
파일: Item.php 프로젝트: tok3/menus
 /**
  * Generates a valid URL for the menu item.
  *
  * @return string
  */
 public function url()
 {
     if (!is_null($this->link)) {
         if ($this->link->href) {
             return $this->link->href;
         }
         return $this->builder->dispatch($this->link->path);
     }
 }