本文整理汇总了PHP中runner::route方法的典型用法代码示例。如果您正苦于以下问题:PHP runner::route方法的具体用法?PHP runner::route怎么用?PHP runner::route使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类runner
的用法示例。
在下文中一共展示了runner::route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rr_property_related
function rr_property_related($model)
{
if ($tags = explode(";", $model->tag)) {
$where_post = array();
$where_product = array();
$params = array();
$i = 0;
foreach ($tags as $tag) {
if (trim(addslashes($tag))) {
$where_post[] = "CONCAT(';', post.tag, ';') LIKE :tag" . $i;
$where_product[] = "CONCAT(';', product.tag, ';') LIKE :tag" . $i;
$params[":tag" . $i] = '%;' . trim(addslashes($tag)) . ';%';
$i++;
}
}
if ($where_post) {
$SQL = "SELECT type, id FROM (" . PHP_EOL;
$SQL .= "SELECT 'post' AS type, post.id, post.date FROM post WHERE" . PHP_EOL;
$SQL .= implode(" OR ", $where_post) . PHP_EOL;
$SQL .= ") AS related_data" . PHP_EOL;
$SQL .= "LEFT JOIN `{PREFIX}models` AS models ON models.model_class = related_data.type AND models.table_id = related_data.id" . PHP_EOL;
$SQL .= "WHERE models.reference <> :reference" . PHP_EOL;
$SQL .= "ORDER BY related_data.date DESC, related_data.id DESC";
$params[":reference"] = $model->reference;
if ($result = \db::query($SQL, $params)) {
echo ' <h3 class="wg-title">Related posts</h3>' . PHP_EOL;
echo ' <ul class="wg-popular-posts">' . PHP_EOL;
foreach ($result as $row) {
$context = array("id = ?" => $row["id"]);
\runner::route($row["type"], $context);
}
echo ' </ul>' . PHP_EOL;
}
}
}
}
示例2: isset
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2014.09.25.
* Time: 15:01
*/
require '../../Routerunner/Routerunner.php';
use Routerunner\Routerunner as runner;
$route = isset($_POST['route']) ? $_POST['route'] : false;
$reference = isset($_POST['reference']) ? $_POST['reference'] : false;
new runner(array('root' => 'standard', 'SITE' => 'appetizer', 'SITENAME' => 'appetizer', 'BASE' => 'http://' . $_SERVER['HTTP_HOST'] . '/appetizer/', 'mode' => 'blank'), function () use($route, $reference) {
$context = array('self' => array('reference' => $reference));
//$model = \model::load($context, $route, $router);
//$router->runner->model = $model;
//$router->runner->path = substr($route, 0, strrpos($route, '/'));
//$router->runner->route = substr($route, strrpos($route, '/'));
$echo = \runner::route($route, $context, $router, true, true);
echo $echo;
});
示例3: isset
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.07.13.
* Time: 11:11
*/
$bootstrap = \bootstrap::get();
$params = $bootstrap->params;
$search = isset($_GET["search"]) ? $_GET["search"] : "";
\runner::route("/backend/pages/user/memberform", array("profile" => \user::me()));
示例4: array
} else {
$where = array('id IN (' . implode(",", $children) . ')' => null);
}
\runner::route($page, $where);
}
} elseif ($resource_uri == "unsubscribe/success") {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
echo ' <h1>Ön sikeresen leiratkozott leveleinkről!<br> Elnézését kérjük a zavarásért, ' . 'a jövőben erre a címre nem fog tőlünk kapni e-mailt!</h1>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
} elseif ($resource_uri == "unsubscribe/error" || strpos($resource_uri, "unsubscribe/") !== false) {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
echo ' <h1><h1>Hiba történt a leiratkozás során!<br>Kérjük írjon a ' . '<a href="mailto:web-plasztika@retroscope.hu" target="_blank">web-plasztika@retroscope.hu</a> címre' . ' és kollégánk rögtön törölni fogja e-mail címét!<br>Elnézését kérjük a zavarásért!</h1>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
} elseif ($current && isset($current["menu"]) && $current["menu"] === "1") {
\runner::route("home");
} elseif (isset($current) && is_array($current) && count($current) === 0 && !\bootstrap::get("url")) {
\runner::route("home");
} else {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
\runner::route("error404");
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
}
?>
</div>
示例5:
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<?php
\runner::route('head');
\runner::route(\runner::now("page"));
\runner::route('foot');
echo \runner::js_after();
?>
</html>
示例6: session_start
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2014.10.20.
* Time: 10:33
*/
session_start();
require $_SESSION["runner_config"]['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SESSION["runner_config"]["SITEROOT"] . $_SESSION["runner_config"]["BACKEND_ROOT"] . 'Routerunner/Routerunner.php';
use Routerunner\Routerunner as runner;
$post = array_merge($_GET, $_POST);
new runner(array('mode' => 'backend', 'scaffold' => 'scaffold', 'params' => $post), function () use($post) {
$router = false;
$route = "/backend/panel/pageproperties";
$override = null;
$root = \runner::config("BACKEND_DIR") . DIRECTORY_SEPARATOR . 'scaffold';
echo \runner::route($route, $post, $router, true, $override, $root);
});
示例7:
<!-- BEGIN HEADER TOP -->
<div class="page-header-top page-header-to-fixed">
<div class="container-fluid row">
<!-- BEGIN ACTION PANEL -->
<div id="routerunner-action-panel" class="col-xs-10 col-sm-10 col-md-6 col-lg-5 pull-right">
<?php
\runner::route('/backend/panel/action');
?>
</div>
<!-- END ACTION PANEL -->
<!-- BEGIN PAGE PROPERTIES -->
<div id="routerunner-pageproperties-panel" class="col-xs-2 col-sm-2 col-md-6 col-lg-7" style="display: none">
<?php
\runner::route('/backend/panel/pageproperties');
?>
</div>
<!-- END PAGE PROPERTIES -->
</div>
</div>
<!-- END HEADER TOP -->
示例8:
</a>
</div>
<h3>Routerunner model panel</h3>
</div>
<div id="routerunner-changes-panel" style="display: none;">
<?php
\runner::route('/backend/panel/changes');
?>
</div>
<div id="routerunner-modelselector-panel">
<?php
\runner::route('/backend/panel/modelselector');
?>
</div>
<div id="routerunner-model-panel">
<?php
\runner::route('/backend/panel/model');
?>
</div>
</div>
<!-- END ROUTERUNNER PANEL -->
</div>
<!-- END CONTAINER -->
<?php
\runner::route('/backend/frame/footer');
?>
</div>
示例9: array
?>
">
</a>
<?php
}
?>
<div class="media-body">
<h4 class="media-heading"><span class="rr-comment-subject"><?php
echo \model::property("subject");
?>
</span>
<small><?php
echo \model::call("date_str");
?>
</small>
</h4>
<div class="rr-comment-comment">
<?php
echo \model::property("comment");
?>
</div>
<a href="#" class="reply-btn" data-reply-to="<?php
echo \model::property("id");
?>
">Reply</a>
</div>
<?php
\runner::route("/desktop/body/content/post/comment", array("model_reference" => \model::property("model_reference"), "reply" => \model::property("id")));
?>
</div>
示例10: elseif
$route = $_route . DIRECTORY_SEPARATOR . $model_class;
} elseif (file_exists($scaffold . $_route . DIRECTORY_SEPARATOR . $model_class . DIRECTORY_SEPARATOR . $model_class . '.runner.php')) {
$route = $_route . DIRECTORY_SEPARATOR . $model_class;
}
$model = $post;
$model["id"] = -1;
$SQL = 'SELECT MIN(table_id) - 1 AS table_id FROM `{PREFIX}models` WHERE model_class = :class AND table_id < 0';
if (($result = \db::query($SQL, array(":class" => $model_class))) && is_numeric($result[0]["table_id"])) {
$model["id"] = $result[0]["table_id"];
}
$model["create"] = $model["id"];
//unset($model['id'], $model['reference'], $model['route']);
if (file_exists($scaffold . $route . DIRECTORY_SEPARATOR . $model_class . '.runner.php')) {
$router = false;
\runner::stack("model_create", array("route" => $route));
\runner::route($route, array("direct" => 0), $router, true, $model);
$return["html"] = $router->runner->html_render;
$return["html_before"] = $router->runner->html_before;
$return["html_after"] = $router->runner->html_after;
if (isset($router->runner->backend_context["model"])) {
$return["backend_context"] = $router->runner->backend_context["model"];
}
\runner::stack("model_create", false);
$models_created = \runner::stack("models_created");
if (!$models_created) {
$models_created = array();
}
$parent = array();
if (isset($post["parent"])) {
$parents = \Routerunner\Bootstrap::parent($post["parent"]);
foreach ($parents as $cur_parent) {
示例11: foreach
foreach ($post['route'] as $post_route_index => $post_route) {
if ($post_route && ($post_route == $treeroot["model_class"] || strpos($post_route, $treeroot["model_class"] . '/') !== false)) {
$treeroot_index = $post_route_index;
break;
}
}
if ($treeroot_index && count($post['route']) > $treeroot_index) {
$route = array_merge($route, array_slice($post['route'], $treeroot_index + 1));
}
}
$tree = \Routerunner\Bootstrap::getTree($post["current"]);
$current = $tree["current"];
//$route[] = $current["model_class"];
}
if ($treeroot && isset($treeroot["reference"])) {
$treeroot = $treeroot["reference"];
} else {
$treeroot = $lang;
}
$context = array('reference' => isset($post["reference"]) && $post["reference"] ? $post["reference"] : $treeroot, 'model_class' => '', 'table_id' => 0, 'route' => $route ? $route : array(''), 'open' => true);
if (isset($post['reference'], $post['model_class'], $post['table_id']) && $post['reference'] && $post['model_class'] && $post['table_id']) {
$context['reference'] = $post['reference'];
$context['model_class'] = $post['model_class'];
$context['table_id'] = $post['table_id'];
$context['route'] = $route;
}
$router = false;
$override = null;
$root = \runner::config("BACKEND_DIR") . DIRECTORY_SEPARATOR . 'scaffold';
echo \runner::route('/backend/tree/container', $context, $router, true, $override, $root);
});
示例12: ucfirst
$label = ucfirst($context['model_class']);
} else {
$label = isset($context['label']) ? $context['label'] : $parsed['text'];
}
?>
<li id="jstreenode_<?php
echo $parsed['id'];
?>
"<?php
echo $html;
?>
data-jstree='<?php
echo json_encode($jstree, JSON_HEX_APOS);
?>
' data-route='<?php
echo json_encode($context['route']);
?>
' data-model='<?php
echo json_encode($model, JSON_HEX_APOS);
?>
'>
<?php
echo $label;
?>
<?php
\runner::route('/backend/tree/container', $context, $router);
?>
</li>
<?php
}
}
示例13: load
public static function load($context = array(), $route = false, &$router = false, $blank = false, $root = false)
{
$model = false;
if (!$route && (isset($context['self']['reference']) || isset($context["direct"]) || isset($context["resource"]))) {
if (isset($context["direct"]) && is_numeric($context["direct"]) || isset($context['self']['reference']) && is_numeric($context['self']['reference'])) {
$SQL = 'SELECT model_class FROM {PREFIX}models WHERE reference = :reference';
if ($result = \db::query($SQL, array(':reference' => isset($context['self']['reference']) ? $context['self']['reference'] : $context["direct"]))) {
$route = '/model/' . $result[0]['model_class'];
}
} elseif (isset($context["direct"]) && is_array($context["direct"])) {
$route = '/model/' . (is_numeric(key($context["direct"])) ? current($context["direct"]) : key($context["direct"]));
} elseif (isset($context["resource"]) && is_array($context["resource"]) && isset($context["resource"][0], $context["resource"][1])) {
$SQL = 'SELECT reference FROM {PREFIX}models WHERE model_class = :class AND table_id = :id';
if ($result = \db::query($SQL, array(':class' => $context["resource"][0], ":id" => $context["resource"][1]))) {
$route = '/model/' . $context["resource"][0];
$context = array("direct" => $result[0]["reference"]);
}
} elseif (isset($context["resource"]) && !is_array($context["resource"]) && strpos($context["resource"], '/') !== false) {
$context["resource"] = explode('/', $context["resource"]);
$SQL = 'SELECT reference FROM {PREFIX}models WHERE model_class = :class AND table_id = :id';
if ($result = \db::query($SQL, array(':class' => $context["resource"][0], ":id" => $context["resource"][1]))) {
$route = '/model/' . $context["resource"][0];
$context = array("direct" => $result[0]["reference"]);
}
}
}
if ($route && $context) {
\runner::route($route, $context, $router, true, $blank, $root);
if (isset($router->runner->model)) {
$model = $router->runner->model;
}
}
if ($model && is_array($model) && count($model) == 1) {
$model = array_shift($model);
}
return $model;
}
示例14:
<div class="input-group">
<input type="text" name="search" class="form-control">
<span class="input-group-btn">
<button class="submit btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
<!-- /.input-group -->
</form>
</div>
<!-- related -->
<?php
\runner::route("/desktop/body/contents/category");
?>
<!-- Side Widget Well -->
<div class="well">
<h4>Side Widget Well</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore, perspiciatis adipisci accusamus laudantium odit aliquam repellat tempore quos aspernatur vero.</p>
</div>
</div>
</div>
<!-- /.row -->
<hr>
示例15:
<?php
\runner::route("header");
?>
<!-- Page Content -->
<div class="container">
<?php
\runner::route("contents");
?>
<?php
\runner::route("footer");
?>
</div>
<!-- /.container -->