Overview

Namespaces

  • Kotchasan
    • Cache
    • Database
    • Http
    • Log
    • Orm
  • None
  • PHP
  • Psr
    • Cache
    • Http
      • Message
    • Log

Classes

  • Accordion
  • ApiController
  • ArrayTool
  • CKEditor
  • Collection
  • Config
  • Controller
  • Country
  • Csv
  • Curl
  • Currency
  • Database
  • DataTable
  • Date
  • DOMNode
  • DOMParser
  • Email
  • File
  • Files
  • Form
  • Grid
  • Html
  • Htmldoc
  • HtmlTable
  • Image
  • InputItem
  • Inputs
  • KBase
  • Language
  • ListItem
  • Login
  • Menu
  • Mime
  • Model
  • Number
  • ObjectTool
  • Password
  • Pdf
  • Province
  • Router
  • Session
  • Singleton
  • Tab
  • TableRow
  • Template
  • Text
  • Validator
  • View

Exceptions

  • ApiException
  • InputItemException
  • Overview
  • Namespace
  • Class
  • Tree

Class Router

Router class.

Kotchasan\KBase
Extended by Kotchasan\Router
Namespace: Kotchasan
Author: Goragod Wiriya admin@goragod.com
Since: 1.0
Located at Kotchasan/Router.php
Methods summary
public static
# init( string $className )

Initial Router.

Initial Router.

Parameters

$className
คลาสที่จะรับค่าจาก Router

Returns

static

Throws

InvalidArgumentException
หากไม่พบคลาสเป้าหมาย
public array
# parseRoutes( string $path, array $modules )

แยก path คืนค่าเป็น query string.

แยก path คืนค่าเป็น query string.

Parameters

$path
เช่น /a/b/c.html
$modules
query string

Returns

array

Assert

('/print.php/css/view/index', array()) [==] array( '_mvc' => 'view', '_dir' => 'index', 'module' => 'css')
('/index/model/updateprofile.php', array()) [==] array( '_mvc' => 'model', '_dir' => 'updateprofile', 'module' => 'index')
('/index.php/alias/model/admin/settings/save', array()) [==] array('module' => 'alias', '_mvc' => 'model', '_dir' => 'admin/settings', '_method' => 'save')
('/css/view/index.php', array()) [==] array('module' => 'css', '_mvc' => 'view', '_dir' => 'index')
('/module/ทดสอบ.html', array()) [==] array('alias' => 'ทดสอบ', 'module' => 'module')
('/module.html', array()) [==] array('module' => 'module')
('/ทดสอบ.html', array()) [==] array('alias' => 'ทดสอบ')
('/ทดสอบ.html', array('module' => 'test')) [==] array('alias' => 'ทดสอบ', 'module' => 'test')
('/index.php', array('_action' => 'one')) [==] array('_action' => 'one')
('/admin_index.php', array('_action' => 'one')) [==] array('_action' => 'one', 'module' => 'admin_index')
Properties summary
protected array $rules

กฏของ Router สำหรับการแยกหน้าเว็บไซต์.

กฏของ Router สำหรับการแยกหน้าเว็บไซต์.

# array( // index.php/module/model/folder/_dir/_method '/^[a-z0-9]+\.php\/([a-z]+)\/(model)(\/([\/a-z0-9_]+)\/([a-z0-9_]+))?$/i' => array('module', '_mvc', '', '_dir', '_method'), // index/model/_dir '/([a-z]+)\/(model|controller|view)\/([a-z0-9_]+)/i' => array('module', '_mvc', '_dir'), // module/alias '/^([a-z]+)\/(.*)$/' => array('module', 'alias'), // module, module.php '/^([a-z0-9_]+)(\.php)?$/' => array('module'), // alias '/^(.*)$/' => array('alias'), )
Properties inherited from Kotchasan\KBase
$cfg, $request
Kotchasan API documentation generated by ApiGen