当前位置: 首页>>代码示例>>PHP>>正文


PHP bootstrap::get方法代码示例

本文整理汇总了PHP中bootstrap::get方法的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap::get方法的具体用法?PHP bootstrap::get怎么用?PHP bootstrap::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bootstrap的用法示例。


在下文中一共展示了bootstrap::get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

UPDATE `{PREFIX}model_metas` SET `keywords` = :keywords WHERE `reference` = :reference

SQL;
                                                    $params_meta = array(":reference" => $model->reference, ":keywords" => strip_tags($keywords));
                                                    \db::query($SQL_meta, $params_meta);
                                                }
                                            }
                                            // save description
                                            if (isset($field_context["is_description"]) && $field_context["is_description"]) {
                                                $SQL_meta = 'SELECT model_meta_id, description ';
                                                $SQL_meta .= 'FROM `{PREFIX}model_metas` ';
                                                $SQL_meta .= 'WHERE `reference` = :reference';
                                                $params_meta = array(":reference" => $model->reference);
                                                $result_meta = \db::query($SQL_meta, $params_meta);
                                                $description = '';
                                                $prefixes = \bootstrap::get("pageproperties_prefix");
                                                if ($prefixes && isset($prefixes["description"])) {
                                                    $description .= $prefixes["description"];
                                                }
                                                $description .= $value;
                                                if (!$result_meta) {
                                                    $SQL_meta = <<<SQL
INSERT INTO `{PREFIX}model_metas` (`reference`, `description`) VALUES (:reference, :description)

SQL;
                                                    $params_meta = array(":reference" => $model->reference, ":description" => preg_replace("/\\t/im", "", preg_replace("/\\n\\n/im", "\n", strip_tags($description))));
                                                    \db::insert($SQL_meta, $params_meta);
                                                } elseif (is_null($result_meta[0]["description"]) || isset($field_context["force_description"]) && $field_context["force_description"]) {
                                                    $SQL_meta = <<<SQL
UPDATE `{PREFIX}model_metas` SET `description` = :description WHERE `reference` = :reference
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:30,代码来源:apply_change.php

示例2:

<?php

/**
 * Created by PhpStorm.
 * User: csibi
 * Date: 2015.07.13.
 * Time: 11:24
 */
$url = \bootstrap::get("url");
?>
<form method="post" id="client-form" role="form">
	<?php 
echo form::input("id");
?>
	<div class="row">
		<div class="col-md-4">
			<div class="row">
				<div class="col-md-12">
					<?php 
echo form::input("label");
?>
				</div>
				<div class="col-md-12">
					<?php 
echo form::input("category");
?>
				</div>
			</div>
			<div class="row">
				<div class="col-md-12">
					<?php 
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:31,代码来源:campaign.frm.form.php

示例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()));
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:12,代码来源:profile.view.php

示例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>
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:30,代码来源:contents.view.php

示例5: elseif

 * User: csibi
 * Date: 2015.02.18.
 * Time: 14:38
 */
if (\runner::now("newpwd") && \runner::now("newpwd") == "succeed") {
    echo '<div class="alert alert-newpwd alert-success">Your new password has been sent to your e-mail address!</div>';
} elseif (\runner::now("newpwd") && \runner::now("newpwd") == "error") {
    echo '<div class="alert alert-newpwd alert-danger">New password confirmation failed!</div>';
}
?>
<!-- BEGIN LOGIN FORM -->
<form id="<?php 
echo \Routerunner\Form::$id;
?>
" action="admin/<?php 
echo \bootstrap::get("url");
?>
" class="login-form" method="post">
	<h3 class="form-title">Login to your account</h3>
	<div class="alert alert-danger display-hide">
		<button class="close" data-close="alert"></button>
		<span>Enter any username and password. </span>
	</div>
	<?php 
echo form::input("email");
?>
	<?php 
echo form::input("password");
?>
	<div class="form-actions">
		<?php 
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:31,代码来源:login.signin.form.php

示例6:

<?php

/**
 * Created by PhpStorm.
 * User: csibi
 * Date: 2015.06.11.
 * Time: 17:03
 */
$debug = 1;
$selected_class = \bootstrap::get("submenu") == \model::property("id") ? ' selected' : '';
$has_children_class = '';
if (\Routerunner\Bootstrap::children(\model::property("reference"))) {
    $has_children_class = ' menu-item-has-children';
}
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:14,代码来源:submenu.event.before.php

示例7: backend_wrapper

 private function backend_wrapper($html = '', $type = 'model', $context = false)
 {
     if ($context) {
         $backend_type_context = $context;
     } elseif (is_callable($this->backend_context[$type])) {
         $backend_type_context = $this->backend_context[$type]($this);
     } else {
         $backend_type_context = $this->backend_context[$type];
     }
     if (!($tree = \runner::config("tree"))) {
         $scaffold = $this->scaffold_root;
         $tree = @(include $scaffold . '/model/tree.php');
     }
     if ($type == 'container') {
         // get parent model
         $parent = 0;
         if (isset($backend_type_context['parent'])) {
             $parent = $backend_type_context['parent'];
         }
         if (!$parent && $this->model && $this->model->reference && ($parents = \Routerunner\Bootstrap::parent($this->model->reference))) {
             $array_pop = array_pop($parents);
             $parent = $array_pop['reference'];
         }
         if (!$parent && isset($backend_type_context['traverse']) && is_array($traverse = $backend_type_context['traverse'])) {
             if (count($traverse) && ($lvl = array_pop($traverse)) && ($parent_table_id = \bootstrap::get($lvl))) {
                 if (is_array($parent_table_id)) {
                     $tmp_parent_table_id = false;
                     foreach ($parent_table_id["parents"] as $tmp_parent) {
                         if ($tmp_parent["model_class"] == $lvl) {
                             $tmp_parent_table_id = $tmp_parent["reference"];
                         }
                     }
                     if ($tmp_parent_table_id) {
                         $parent_table_id = $tmp_parent_table_id;
                     }
                 }
                 $SQL = 'SELECT reference FROM {PREFIX}models WHERE model_class = :class AND table_id = :table_id';
                 if ($result = \db::query($SQL, array(':class' => $lvl, ':table_id' => $parent_table_id))) {
                     $parent = $result[0]['reference'];
                 }
             }
         }
         // get acceptable models
         $accept = array();
         if (isset($backend_type_context['accept'])) {
             $accept = $backend_type_context['accept'];
         } elseif (isset($backend_type_context['traverse']) && ($branch = \Routerunner\Helper::tree_route($tree, $backend_type_context['traverse'], $this->model))) {
             foreach ($branch['children'] as $child_class => $child_params) {
                 if (isset($child_params['blank'])) {
                     $blank[] = $child_class;
                     $accept[$child_class] = $child_params['blank'];
                 }
             }
         }
         $backend_type_context['parent'] = $parent;
         $backend_type_context['blank'] = $accept;
         if (!isset($backend_type_context['wrapper'])) {
             $backend_type_context['wrapper'] = array('class' => '');
         } elseif (!isset($backend_type_context['wrapper']['class'])) {
             $backend_type_context['wrapper']['class'] = '';
         }
         $classes = explode(' ', $backend_type_context['wrapper']['class']);
         $classes = array_merge($classes, array_keys($accept));
         $backend_type_context['wrapper']['class'] .= implode(' ', $classes);
     }
     $dom = false;
     if ($html) {
         if (isset($backend_type_context['template']['opening'])) {
             $dom = \phpQuery::newDocument($backend_type_context['template']['opening'] . $html . $backend_type_context['template']['closing']);
             if (!$dom) {
                 $dom = \phpQuery::newDocumentHTML($html);
             }
         } elseif (isset($backend_type_context['wrapper']['element'])) {
             $dom = \phpQuery::newDocumentHTML($html, $charset = 'utf-8');
             $dom = $this->dom_wrapper($dom, $backend_type_context['wrapper']['element'], null);
         } else {
             $dom = \phpQuery::newDocumentHTML($html);
         }
     } elseif (isset($backend_type_context['wrapper']['element'])) {
         $html = '<' . $backend_type_context['wrapper']['element'] . '></' . $backend_type_context['wrapper']['element'] . '>';
         $dom = \phpQuery::newDocumentHTML($html);
     } elseif (isset($backend_type_context['template']['opening'])) {
         $html = $backend_type_context['template']['opening'] . $backend_type_context['template']['closing'];
         $dom = \phpQuery::newDocumentHTML($html);
     }
     $root_nodes = array();
     if ($dom && isset($backend_type_context['selector'])) {
         $root_nodes = pq($backend_type_context['selector'] . ":not(.routerunner-" . $type . ")");
     } elseif ($dom) {
         $root_nodes = $dom->children(":not(.routerunner-" . $type . ")");
     }
     $model = false;
     if ($type == 'model' && isset($this->model)) {
         $model = $this->model;
     } elseif ($type == 'container' && isset($backend_type_context['blank'])) {
         $model = new \stdClass();
         $model->reference = 0;
         foreach ($backend_type_context['blank'] as $blank_field => $blank_value) {
             $model->{$blank_field} = $blank_value;
         }
//.........这里部分代码省略.........
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:101,代码来源:BaseRunner.php

示例8: elseif

     $route[] = 'menu';
     $route[] = 'submenu';
 } elseif ($menu) {
     $route[] = 'menu';
 }
 $scaffold = \Routerunner\Helper::$scaffold_root;
 $tree = @(include $scaffold . '/model/tree.php');
 foreach ($references as $reference) {
     $override = array();
     if (is_array($reference)) {
         $override = $reference;
         if (isset($reference["reference"])) {
             unset($override["reference"]);
             $reference = $reference["reference"];
         } else {
             $reference = \bootstrap::get("reference");
         }
     }
     $label = "new element";
     $context = array("direct" => $reference, "silent" => true);
     $model = \model::load($context);
     if (is_array($model)) {
         $model = array_shift($model);
     }
     if ($model) {
         $label = $model->label;
     }
     $branch = \Routerunner\Helper::tree_route($tree, $route, $model);
     $container = array('traverse' => $route, 'selector' => '.rr-content-container', 'child_selector' => '.rr-model', 'reference' => $reference, 'parent' => $reference, 'prev' => '0', 'label' => $label, 'accept' => array());
     if (isset($branch["children"])) {
         unset($branch["children"]["submenu"]);
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:31,代码来源:contents.backend.container.php

示例9: function

<?php

/**
 * Created by PhpStorm.
 * User: csibi
 * Date: 2015.04.07.
 * Time: 16:32
 */
$debug = 1;
return function ($runner) {
    $model = false;
    if ($menu = \bootstrap::get("menu")) {
        $context = array("id = ?" => $menu);
        $model = \model::load($context, "menu");
    }
    $label = 'menu';
    if ($model && $model->label) {
        $label = $model->label;
    }
    $return = array(array('traverse' => array(''), 'selector' => '.nav.navbar-nav', 'child_selector' => '> li.rr-menu-model', 'parent' => \runner::config("language"), 'prev' => '0', 'label' => 'menu', 'accept' => array('menu' => array("label" => "new menu"))));
    return $return;
};
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:22,代码来源:header.backend.container.php

示例10: foreach

        $opencart->cart->add($_POST["product"], $_POST["item"]);
        $cart = $opencart->cart->products();
        foreach ($cart['products'] as $product) {
            echo $product['name'] . "\n";
        }
    } else {
        echo $opencart->getLastError();
    }
    $order = $opencart->order->add('', '', '', '', 'dasdasd u. 1.');
    $saved = false;
    if (isset($return_params[":nonce"], $_SESSION["nonce"]) && \Routerunner\Crypt::checker($return_params[":nonce"], $_SESSION["nonce"])) {
        unset($_SESSION["nonce"]);
        //OpenCart->order->edit($order_id, $shipping_method = '', $comment = '', $affiliate_id = '', $order_status_id = '')
        if ($id = \db::insert($return_SQL, $return_params)) {
            $saved = true;
            $url = bootstrap::get('resource_url');
            echo <<<HTML
<h1 class="order-form-success text-success">Successfully saved!</h1>
<script>
\tsetTimeout(function() {
\t\twindow.location.href = "{$url}";
\t}, 1000);
</script>
HTML;
        }
    }
    if (!$saved) {
        echo '	<h1 class="text-danger">Error happened!</h1>';
    }
} else {
    echo '	<h1 class="text-danger">Error happened!</h1>';
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:31,代码来源:product.order.submit.php

示例11: array

 * User: csibi
 * Date: 2015.11.16.
 * Time: 20:36
 */
$contents = array();
$title = "";
$subtitle = "";
if ($current = \bootstrap::get("current")) {
    $type = key($current);
    $type_id = $current[$type];
    if ($model = \model::load(array("resource" => array($type, $type_id)))) {
        $title = $model->label;
    }
}
$bread_str = "<li><a href=\"" . \runner::config("BASE") . "\" title=\"Home\">Home</a></li>";
if ($breadcrumb = \bootstrap::get("breadcrumb")) {
    $i = 0;
    foreach ($breadcrumb as $type => $type_id) {
        $i++;
        $breadcrumb_model = \model::load(array("resource" => array($type, $type_id)));
        if ($i >= count($breadcrumb)) {
            $bread_str .= "<li class=\"active\">" . $breadcrumb_model->label . "</li>";
        } else {
            $bread_str .= "<li><a href=\"" . \model::url(false, $breadcrumb_model) . "\">" . $breadcrumb_model->label . "</a></li>";
        }
    }
}
?>
<!-- Page Heading/Breadcrumbs -->
<div class="row">
	<div class="col-lg-12">
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:31,代码来源:content_header.view.php


注:本文中的bootstrap::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。