public function __construct()
 {
     $this->app = \GF\App::getInstance();
     $this->view = \GF\View::getInstance();
     $this->config = $this->app->getConfig();
     $this->input = \GF\InputData::getInstance();
 }
示例#2
0
 private function __construct()
 {
     $this->___viewPath = \GF\App::getInstance()->getConfig()->app['viewsDirectory'];
     if ($this->___viewPath == null) {
         $this->___viewPath = realpath('../views/');
     }
 }
 public function __construct($connection = null)
 {
     if ($connection instanceof \PDO) {
         $this->db = $connection;
     } else {
         if ($connection != null) {
             $this->db = \GF\App::getInstance()->getDBConnection($connection);
             $this->connection = $connection;
         } else {
             $this->db = \GF\App::getInstance()->getDBConnection($this->connection);
         }
     }
 }
 public function getURI()
 {
     if (!is_array($this->_map) || count($this->_map) == 0) {
         $ar = \GF\App::getInstance()->getConfig()->rpcRoutes;
         if (is_array($ar) && count($ar) > 0) {
             $this->_map = $ar;
         } else {
             throw new \Exception('Router require method map', 500);
         }
     }
     $request = json_decode(file_get_contents('php://input'), true);
     if (!is_array($request) || !isset($request['method'])) {
         throw new \Exception('Require json request', 400);
     } else {
         if ($this->_map[$request['method']]) {
             $this->_requestId = $request['id'];
             $this->_post = $request['params'];
             return $this->_map[$request['method']];
         } else {
             throw new \Exception('Method not found', 501);
         }
     }
 }
示例#5
0
<?php

//WARNING
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
include '../../gf/App.php';
$app = \GF\App::getInstance();
$app->run();
示例#6
0
文件: userbar.php 项目: veelko/money
<?php

$servarname = $_SERVER['SERVER_NAME'];
?>
<div style="border-bottom: solid 1px black; border-left: 1px solid black; border-right: 1px solid black;">
    <div style="display: inline-block; width: 33%;">
        <a href="http://<?php 
echo $servarname;
?>
" style="margin-left: 25px; font-size: 25px; text-decoration: none;">uSaveBucks.com :: money saving site</a>
    </div>
    <div style="display: inline-block; width: 33%;">
        <?php 
$userData = \GF\App::getInstance();
if ($userData->getSession()->username) {
    ?>
            <center>
                Здравей, <?php 
    echo $userData->getSession()->username;
    ?>
!
            </center>
        </div>
        <div style="display: inline-block; width: 33.3%;">
            <center>
                <a href="http://<?php 
    echo $servarname;
    ?>
/logout" style="float: right; padding-left: 10px; padding-right: 10px;">Излез</a>
                <a href="http://<?php 
    echo $servarname;
示例#7
0
文件: menu.php 项目: veelko/money
<div id="menu">
    <ul>
        <?php 
foreach ($this->menu as $menu) {
    if ($menu['page'] == 'otherpage') {
        echo "<li><a href='" . $menu['link'] . "'>" . $menu['text'] . "</a></li>";
    } else {
        if ($menu['page'] == '') {
            $link = explode('/', substr($_SERVER["REQUEST_URI"], 1))[0];
            echo "<li><a href='http://" . $_SERVER['SERVER_NAME'] . "/" . $link . "'>" . $menu['text'] . "</a></li>";
        } else {
            $link = explode('/', substr($_SERVER["REQUEST_URI"], 1))[0];
            echo "<li><a href='http://" . $_SERVER['SERVER_NAME'] . "/" . $link . "/page/" . $menu['page'] . "'>" . $menu['text'] . "</a></li>";
        }
    }
}
if ($this->blogData['user_id'] == \GF\App::getInstance()->getSession()->user_id) {
    $servarname = $_SERVER['SERVER_NAME'];
    echo "<li style='float: right'><a href='http://{$servarname}/" . $this->blogData['link'] . "/edit/blogpanel'>Блог панел</a></li>";
}
?>

    </ul>	
</div>
 public function getDefaultMethod()
 {
     $method = \GF\App::getInstance()->getConfig()->app['default_method'];
     if ($method) {
         return strtolower($method);
     }
     return 'index';
 }
示例#9
0
<?php

include '../../gf/App.php';
$app = \GF\App::GetInstance();
//\GF\Loader::registerNamespace('\Test\Models', '\work\mvcframework\trunk\gftest\models');
$app->run();
示例#10
0
<div id="panels">
    <center>
        <br />
        <font size="5"><b>Редактиране на менюто</b></font>
        <br />
        <font color="red">Подредбата има значение!</font>

        <p>
            <br />
            <?php 
if (\GF\App::getInstance()->getSession()->user_id != $this->blogData['user_id']) {
    $servarname = $_SERVER['SERVER_NAME'];
    header("Location: http://{$servarname}/" . $this->blogData['link']);
    /* Redirect browser */
    exit;
}
?>

        <form action="" method="post" id="menuform">
            <p>
                <?php 
$i = 1;
foreach ($this->menu as $value) {
    //                    <input type='text' name='link_$i' value='" . $value['link'] . "' />
    echo "Текст: <input type='text' name='text_{$i}' value='" . $value['text'] . "' /> => Страница: <select name='page_{$i}' >";
    echo '<option value="">нищо/начало</option>';
    $selected_page = $value['page'] == 'otherpage' ? 'selected' : '';
    echo "<option value='otherpage' " . $selected_page . ">Линк към друг сайт</option>";
    foreach ($this->pages as $page) {
        $selected = $value['page'] == $page['link'] ? 'selected' : '';
        echo "<option value='" . $page['link'] . "' " . $selected . ">" . $page['link'] . "</option>";