/** * パス文字列をhref文字列に変換しh()に通し出力する */ function href($path, $protocol = NULL, $hidden = FALSE) { $path = segments_to_path(path_to_segments($path, TRUE, TRUE)); return site_url($path, $protocol, $hidden); }
<?php if (preg_match('#^' . dirname($_SERVER['SCRIPT_NAME']) . '/index#', $_SERVER['REQUEST_URI']) !== 0) { echo 'URI must not begin with index.'; exit(1); } require_once BASEPATH . plug([$packages, ['common.php']]); require_once BASEPATH . plug([$packages, ['plug.php']]); plug_config('wild_targets'); plug_config('segments'); $instance =& get_instance(); foreach ($instance->config['wild_targets'] as $array) { foreach ($array as $value) { $instance->config['segments']['target'][] = $value; } } $instance->segments = path_to_segments($_SERVER['PATH_INFO']); $plugged = plug_controller($instance->segments['target']); $class = preg_replace('/.php$/', '', basename($plugged)); $instance = new $class(); call_user_func_array([$instance, $instance->segments['action']], $instance->segments['args']);