Joostina CMS / CMF v2.* API
  • Docs
  • Package
  • Class
  • Tree
  • Todo
Overview

Packages

  • Components
    • Acls
      • Models
        • Admin
        • Site
    • BlogCategory
      • Models
        • Admin
        • Site
    • Blogs
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • Coder
      • Controllers
        • Admin
      • Models
        • Admin
    • Comments
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • CommentsCounter
      • Models
        • Admin
        • Site
    • Mainpage
      • Controllers
        • Site
    • News
      • Controllers
        • Admin
        • Site
      • Helpers
      • Models
        • Admin
        • Site
    • Pages
      • Controllers
        • Admin
        • Site
      • Models
        • Site
    • Search
      • Controllers
        • Site
    • Site
      • Controllers
        • Admin
        • Site
    • Sitemap
      • Controllers
        • Admin
        • Site
      • Models
        • Admin
        • Site
    • Test
      • Controllers
        • Site
    • Torrents
      • Controllers
        • Site
    • Users
      • Controllers
        • Admin
        • Site
      • Models
        • Admin
        • Site
  • Compression
  • Core
    • Libraries
      • Arhive
      • Array
      • Attached
      • Autoadmin
      • Autoloader
      • Benchmark
      • Breadcrumbs
      • Cache
      • Config
      • Cookie
      • Csrf
      • Database
        • Drivers
          • Interfaces
      • Datetime
      • Debug
      • Editor
      • Events
      • File
      • Filter
      • Flashmessage
      • Folder
      • Hit
      • Html
      • Image
      • Inflector
      • Inputfilter
      • Libraries
      • Mail
      • Module
      • Nestedset
      • Pager
      • Pages
      • Params
      • Randomizer
      • Request
      • RobotLoader
      • Route
      • Security
      • Session
      • Static
      • String
      • Text
      • Trash
      • Validate
  • Email
  • Extra
    • Libraries
      • Basket
  • Joostina
    • Controller
    • Core
    • Document
  • JSMin
  • Libraries
    • Extra
      • Basket
        • Models
          • Site
  • None
  • Plugins
    • Autoadmin
    • Editor
    • Sitemap
  • SimpleMail
  • Vendors
    • Libraries
      • Email

Classes

  • helperAcl
  • joosAdminToolbarButtons
  • joosAdminView
  • joosAdminViewToolbarEdit
  • joosAdminViewToolbarListing
  • joosAutoadminHTML
  • joosTemplater
  • joosValidateHelper
  • modelAdminCoder_Faker
  • moduleActions
  • moduleActionsLogin
  • moduleActionsMenu
  • moduleActionsNews
  • moduleActionsTest
  • Route
  • rulesValidation
  • TreeBuilder

Interfaces

  • joosAutoadminPluginsEdit
  • joosAutoadminPluginsTable

Exceptions

  • joosAutoadminClassPlugionNotFoundException
  • joosAutoadminFilePluginNotFoundException
  • joosAutoloaderClassNotFoundException
  • joosAutoloaderFileNotFoundException
  • joosAutoloaderOnStartFileNotFoundException
  • joosCacheException
  • joosCoreException
  • joosDatabaseException
  • joosException
  • joosFileLibrariesException
  • joosFolderLibrariesException
  • joosImageLibrariesException
  • joosModulesException
  • joosSimpleMailException
  • joosUploadLibrariesException
  • joosUserException
  • JSMinException

Functions

  • navigation_ul_li_recurse
  • quoted_printable_encode

Class Route

Базовый класс роутинга Базируется на оригинальной работе Kohana Team

Direct known subclasses

joosRoute
Located at: core/libraries/route.php

Methods summary

protected static Route
# set( string $name, string $uri_callback = NULL, array $regex = NULL )

Stores a named route and returns it. The "action" will always be set to "index" if it is not defined.

Stores a named route and returns it. The "action" will always be set to "index" if it is not defined.

self::set('default', '(<controller>(/<action>(/<id>)))') ->defaults(array( 'controller' => 'welcome', ));

Parameters

$name
string
route name
$uri_callback
string
URI pattern
$regex
array
regex patterns for route keys

Returns

Route
protected static Route
# get( string $name )

Retrieves a named route.

Retrieves a named route.

$route = self::get('default');

Parameters

$name
string
route name

Returns

Route

Throws

joosException
protected static array
# all( )

Retrieves all named routes.

Retrieves all named routes.

$routes = self::all();

Returns

array
routes by name
public
# __construct( mixed $uri = NULL, array $regex = NULL )

Creates a new route. Sets the URI and regular expressions for keys. Routes should always be created with [self::set] or they will not be properly stored.

Creates a new route. Sets the URI and regular expressions for keys. Routes should always be created with [self::set] or they will not be properly stored.

$route = new Route($uri, $regex);

Parameters

$uri
mixed
route URI pattern
$regex
array
key patterns

Uses

self::_compile
protected $this
# defaults( array $defaults = NULL )

Provides default values for keys when they are not present. The default action will always be "index" unless it is overloaded here.

Provides default values for keys when they are not present. The default action will always be "index" unless it is overloaded here.

$route->defaults(array( 'controller' => 'welcome', 'action' => 'index' ));

Parameters

$defaults
array
key values

Returns

$this
protected array
# matches( string $uri )

Tests if the route matches a given URI. A successful match will return all of the routed parameters as an array. A failed match will return boolean FALSE.

Tests if the route matches a given URI. A successful match will return all of the routed parameters as an array. A failed match will return boolean FALSE.

// Params: controller = users, action = edit, id = 10 $params = $route->matches('users/edit/10');

This method should almost always be used within an if/else block:
if ($params = $route->matches($uri)) { // Parse the parameters }

Parameters

$uri
string
URI to match

Returns

array
on success
false
on failure
protected string
# uri( array $params = NULL )

Generates a URI for the current route based on the parameters given.

Generates a URI for the current route based on the parameters given.

// Using the "default" route: "users/profile/10" $route->uri(array( 'controller' => 'users', 'action' => 'profile', 'id' => '10' ));

Parameters

$params
array
URI parameters

Returns

string

Throws

joosException

Uses

self::REGEX_Key

Constants summary

string REGEX_KEY '<([a-zA-Z0-9_]++)>'
#
string REGEX_SEGMENT '[^/.,;?\n]++'
#
string REGEX_ESCAPE '[.\\+*?[^\\]${}=!|]'
#

Properties summary

public static string $default_protocol 'http://'
#

default protocol for all routes

default protocol for all routes

Tutorial

'http://'
public static string $default_action 'index'
#

default action for all routes

default action for all routes

public static boolean $cache FALSE
#

Indicates whether routes are cached

Indicates whether routes are cached

protected static array $_routes array()
#
protected string $_uri ''
#

route URI

route URI

protected array $_regex array()
#
protected array $_defaults array('action' => 'index', 'host' => FALSE)
#
protected string $_route_regex
#
Joostina CMS / CMF v2.* API API documentation generated by ApiGen 2.6.1 – Template adapted by @olvlv and Joostina Team