本文整理匯總了PHP中Import::helper方法的典型用法代碼示例。如果您正苦於以下問題:PHP Import::helper方法的具體用法?PHP Import::helper怎麽用?PHP Import::helper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Import
的用法示例。
在下文中一共展示了Import::helper方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($request_uri, $params = array(), $view_params = array())
{
$this->request_uri = $request_uri;
$this->params = $params;
$this->view_params = $view_params;
$this->template = $params["controller"] . "/" . $params["action"];
if (Import::helper($params["controller"])) {
$this->helper = $params['controller'] . "Helper";
} else {
$this->helper = false;
}
}
示例2: handle_request
public function handle_request($params)
{
if (array_key_exists("format", $params) === false) {
$params["format"] = "html";
}
$this->params = $params;
$controller_name = Inflector::camelize($params["controller"], "first");
Logger::process_controller($controller_name, $params["action"], env("REQUEST_METHOD"), $params);
if (Import::controller($params["controller"])) {
Import::helper($params["controller"]);
$helper_name = "{$controller_name}Helper";
$this->controller = new $controller_name($this->request_uri, $params);
if (class_exists($helper_name)) {
$this->controller->helper = new $helper_name();
}
$action = $params["action"];
} else {
$this->controller = new self($this->request_uri, $params);
$action = "not_found";
$this->controller->{$action}();
}
$this->controller->format = $this->params["format"];
$this->controller->handle_action($action);
}