Source for file Simple.php
Documentation is available at Simple.php
* @author Keisuke SATO <riaf@me.com>
* @version $Id: b05bd254b9b40e0c2f998380421e86bf7868467c $
* @author Keisuke SATO <riaf@me.com>
/** @var array アクションマッピング */
// 'wozozo_index' => '/wozozo',
// 'wozozo_message' => '/wozozo/{message}',
// 'message_show' => array(
// 'path' => '/message/{id}',
if (isset
($action_map[$action])) {
$def =
$action_map[$action];
$paths =
$this->sortPaths($def['path'], SORT_DESC);
foreach ($paths as $path) {
foreach ($keys as $key) {
if (isset
($param[$key])) {
} else if (isset
($def['defaults']) && isset
($def['defaults'][$key])) {
$val =
$def['defaults'][$key];
$replaces['{'.
$key.
'}'] =
$val;
$ret =
array($path, array());
* @param array $http_vars
if (isset
($http_vars['__url_info__'])) {
foreach ($def['path'] as $pattern) {
$detected_action =
$action;
if ($path ===
$pattern) {
$detected_action =
$action;
* @param array $http_vars
$regex_pattern =
array();
foreach ($def['path'] as $pattern) {
$request_keys =
$matches[1];
foreach ($matches[0] as $i =>
$from) {
if (isset
($def['patterns']) && isset
($def['patterns'][$key])) {
$to =
'('.
$def['patterns'][$key].
')';
foreach ($request_keys as $i =>
$key) {
if (isset
($match[$i+
1])) {
$http_vars[$key] =
$match[$i+
1];
* Ethna_UrlHandlerクラスのインスタンスを取得する
* $name がクラス名 ('_'を含む) の場合はそのクラスを、
* そうでないときはプラグイン名とみなしてインスタンスを返す
static $instance =
array();
if (isset
($instance[$name])) {
if (strpos($name, '_') !==
false) {
$instance[$name] =
new $name();
// get instance with plugin
$plugin =
$ctl->getPlugin();
$instance[$name] =
$plugin->getPlugin('Urlhandler', $name);
* より複雑な定義などを行うときはこれをオーバーライドする
$def['path'] =
array($def['path']);
return array($path, false);
$path =
'/'.
trim($path, '/');
protected function sortPaths(array $paths, $sort =
SORT_ASC)
foreach ($paths as $path) {
$key =
sprintf('action_%s', $action);
$http_vars[$key] =
'true';
Documentation generated on Fri, 11 Nov 2011 03:59:04 +0900 by phpDocumentor 1.4.3