Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ActiveRecord
  • Cache
  • Configs
  • Core
  • DateTime
  • Debug
  • DeleteOperation
  • Errors
  • Event
  • EventHook
  • Events
  • FileCache
  • FormattedString
  • Helpers
  • I18n
  • Image
  • Inflections
  • Inflector
  • Models
  • Module
  • Modules
  • Object
  • Operation
  • PingOperation
  • Prototype
  • Route
  • Routes
  • SaveOperation
  • Session
  • TimeZone
  • TimeZoneLocation
  • Uploaded
  • Vars
  • VarsIterator

Interfaces

  • StorageInterface
  • ToArray
  • ToArrayRecursive

Traits

  • PrototypeTrait
  • ToArrayRecursiveTrait

Exceptions

  • AlreadyAuthenticated
  • AuthenticationRequired
  • Exception
  • ModuleConstructorMissing
  • ModuleIsDisabled
  • ModuleNotDefined
  • OffsetError
  • OffsetNotDefined
  • OffsetNotReadable
  • OffsetNotWritable
  • PermissionRequired
  • PropertyError
  • PropertyIsReserved
  • PropertyNotDefined
  • PropertyNotReadable
  • PropertyNotWritable
  • RouteNotDefined
  • SecurityException

Constants

  • TOKEN_ALPHA
  • TOKEN_ALPHA_UPCASE
  • TOKEN_NUMERIC
  • TOKEN_SYMBOL
  • TOKEN_SYMBOL_WIDE

Functions

  • array_flatten
  • array_insert
  • array_merge_recursive
  • camelize
  • capitalize
  • downcase
  • dump
  • escape
  • escape_all
  • exact_array_merge_recursive
  • excerpt
  • format
  • generate_token
  • generate_token_wide
  • generate_v4_uuid
  • get_autoconfig
  • humanize
  • hyphenate
  • log
  • log_error
  • log_info
  • log_success
  • log_time
  • normalize
  • normalize_namespace_part
  • normalize_url_path
  • pbkdf2
  • pluralize
  • remove_accents
  • shorten
  • singularize
  • sort_by_weight
  • stable_sort
  • strip_root
  • titleize
  • unaccent_compare
  • unaccent_compare_ci
  • underscore
  • upcase
  1 <?php
  2 
  3 /*
  4  * This file is part of the ICanBoogie package.
  5  *
  6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
  7  *
  8  * For the full copyright and license information, please view the LICENSE
  9  * file that was distributed with this source code.
 10  */
 11 
 12 namespace ICanBoogie;
 13 
 14 use ICanBoogie\Routing\Pattern;
 15 
 16 /**
 17  * A route.
 18  *
 19  * @property-read \ICanBooogie\Routing\Pattern $pattern The pattern of the route.
 20  */
 21 class Route extends Object
 22 {
 23     /**
 24      * Pattern of the route.
 25      *
 26      * @var \ICanBooogie\Routing\Pattern
 27      */
 28     private $pattern;
 29 
 30     protected function get_pattern()
 31     {
 32         return $this->pattern;
 33     }
 34 
 35     /**
 36      * Controller's class name or function.
 37      *
 38      * @var string
 39      */
 40     private $controller;
 41 
 42     protected function get_controller()
 43     {
 44         return $this->controller;
 45     }
 46 
 47     /**
 48      * Identifier of the route.
 49      *
 50      * @var string
 51      */
 52     public $id;
 53 
 54     /**
 55      * Redirect location.
 56      *
 57      * If the property is defined the route is considered an alias.
 58      *
 59      * @var string
 60      */
 61     public $location;
 62 
 63     /**
 64      * Request methods accepted by the route.
 65      *
 66      * @var string
 67      */
 68     public $via;
 69 
 70     /**
 71      * Initializes the {@link $pattern} property and the properties provided.
 72      *
 73      * @param string $pattern
 74      * @param array $properties
 75      */
 76     public function __construct($pattern, array $properties)
 77     {
 78         $this->pattern = Pattern::from($pattern);
 79 
 80         unset($properties['pattern']);
 81 
 82         foreach ($properties as $property => $value)
 83         {
 84             $this->$property = $value;
 85         }
 86     }
 87 
 88     public function __get($property)
 89     {
 90         switch ($property)
 91         {
 92             case 'url':
 93             {
 94                 if (isset($this->url_provider))
 95                 {
 96                     $class = $this->url_provider;
 97                     $provider = new $class();
 98 
 99                     return $provider($this);
100                 }
101             }
102             break;
103         }
104 
105         return parent::__get($property);
106     }
107 
108     /**
109      * Returns the pattern of the route.
110      *
111      * @return string
112      */
113     public function __toString()
114     {
115         return (string) $this->pattern;
116     }
117 
118     /**
119      * Formats the route with the specified values.
120      *
121      * Note: The formatting of the route is defered to its {@link Pattern} instance.
122      *
123      * @return string
124      */
125     public function format($values=null)
126     {
127         return $this->pattern->format($values);
128     }
129 }
Autodoc API documentation generated by ApiGen 2.8.0