本文整理汇总了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);
}