Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Route

This class describes the routes behavior

Hawk\Route uses Hawk\Utils
Namespace: Hawk
Package: Core\Router
Located at Route.php

Methods summary

public
# __construct( string $name, string $url, array $param )

Constructor

Constructor

Parameters

$name
The route name
$url
The route URI pattern
$param

The route parameters, containing the pattern rules, the default values, the action associated with this route

public string
# getName( )

Get the route name

Get the route name

Returns

string
the route name
public boolean
# match( string $path )

Check if the route pattern match with a given URI, and if it matches, set the route data

Check if the route pattern match with a given URI, and if it matches, set the route data

Parameters

$path
The URI to check

Returns

boolean
true if the URI match the route, else False
public mixed
# getData( string $prop = null )

Get the route data

Get the route data

Parameters

$prop

If set, the method will return the data value for this property. If not set, it will return the whole route data

Returns

mixed
If $prop is set, the data value for this property, else the whole route data
public
# setData( string $key, mixed $value )

Set the route data

Set the route data

Parameters

$key
The property name of the data to set
$value
The value to set
public string
# getAction( )

Get the route action

Get the route action

Returns

string
The action associated with the route, formatted like : '.'
public
# getActionClassname( )

Get the route action controller class

Get the route action controller class

public
# getActionMethodName( )

Get the route action method name

Get the route action method name

public boolean
# isAccessible( )

Check of the route is accessible by the web client

Check of the route is accessible by the web client

Returns

boolean
True if the route is accessible, False in other case

Methods used from Hawk\Utils

debug(), getSerializedVersion(), map()

Properties summary

public string $url

The route URL

The route URL

# ''
public string $prefix

The route URL prefix

The route URL prefix

# ''
public string $namespace

The action namespace

The action namespace

# ''
public array $where

The pattern rules

The pattern rules

# array()
public array $default

The default values of the route parameters

The default values of the route parameters

Param

array
# array()
public string $action

The route action

The route action

Param

string
# ''
public string $pattern

The route pattern

The route pattern

Param

string
# ''
Hawk - PHP documentation API documentation generated by ApiGen