當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Flight::route方法代碼示例

本文整理匯總了PHP中Flight::route方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flight::route方法的具體用法?PHP Flight::route怎麽用?PHP Flight::route使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Flight的用法示例。


在下文中一共展示了Flight::route方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: session_start

<?php

session_start();
define('ROOT', dirname(__FILE__));
require "flight/Flight.php";
require 'constants/conContainer.php';
require "models/modContainer.php";
require "controllers/objContainer.php";
require "tools/tooContainer.php";
/*引入配置文件*/
$error_info = parse_ini_file("configs/error.ini");
Flight::set('errorn', $error_info);
Flight::route('/', function () {
    echo 'hello world! :-)';
});
Flight::start();
開發者ID:Birjemin,項目名稱:Cmd_library,代碼行數:16,代碼來源:index.php

示例2: __construct

 function __construct()
 {
     Flight::route("GET /test", function () {
         $this->test();
     });
     Flight::route("POST /createuser", function () {
         $this->createUSer();
     });
 }
開發者ID:pamidu,項目名稱:LedgerService,代碼行數:9,代碼來源:userlibrary.php

示例3: __construct

 function __construct()
 {
     Flight::route("POST /media/@namespace/@class/@id", function ($namespace, $class, $id) {
         $this->uploadMedia($namespace, $class, $id);
     });
     Flight::route("GET /media/@namespace/@class/@id", function ($namespace, $class, $id) {
         $this->getMedia($namespace, $class, $id);
     });
     Flight::route("GET /media/test", function () {
         $this->test();
     });
     Flight::route("GET /thumbnails/@size/@namespace/@class/@id", function ($size, $namespace, $class, $id) {
         $this->getThumbnail($size, $namespace, $class, $id);
     });
 }
開發者ID:pamidu,項目名稱:DuoWorldMediaservice-,代碼行數:15,代碼來源:mediaservice.php

示例4: __construct

 function __construct()
 {
     Flight::route("GET /getInvoiceNumber", function () {
         $this->getInvoiceNumber();
     });
     Flight::route("POST /createLedgerEntry", function () {
         $this->createLedgerEntry();
     });
     Flight::route("POST /transactionForTennent", function () {
         $this->transactionForTennent();
     });
     Flight::route("POST /transactionDetails", function () {
         $this->TransactionDetails();
     });
     Flight::route("POST /payment ", function () {
         $this->Payment();
     });
 }
開發者ID:pamidu,項目名稱:LedgerService,代碼行數:18,代碼來源:leger.php

示例5: function

Flight::route('/administracion/alta-de-usuario/', function () {
    require_once 'controllers/administracion/usuario_controller.php';
});
Flight::route('/administracion/guarda-usuario/', function () {
    require_once 'controllers/administracion/guardaUsuario_controller.php';
});
Flight::route('/administracion/duracion-de-servicios/', function () {
    require_once 'controllers/administracion/duracion_servicios_controller.php';
});
Flight::route('/administracion/actualizacion-de-duracion/', function () {
    require_once 'controllers/administracion/actualizaDuracion_controller.php';
});
Flight::route('/administracion/firmas-autorizadas/', function () {
    require_once 'controllers/administracion/firmas_autorizadas_controller.php';
});
Flight::route('/administracion/actualiza-firmas/', function () {
    require_once 'controllers/administracion/actualizaFirmas_controller.php';
});
/*Ayuda*/
Flight::route('/ayuda/cambiar-contra/', function () {
    require_once 'controllers/ayuda/cambiarContra_controller.php';
});
/*Salir*/
Flight::route('/salir/', function () {
    session_start();
    $_SESSION = array();
    session_destroy();
    session_unset();
    Flight::redirect('/');
});
Flight::start();
開發者ID:raulmedinacampos,項目名稱:iibi_sus,代碼行數:31,代碼來源:index.php

示例6: function

    $cgi->getPkgAtt();
});
Flight::route('POST /user/', function () {
    $user = new user\src\User();
    $user->register();
});
Flight::route('GET /user/', function () {
    $user = new user\src\User();
    $user->getUserInfo();
});
Flight::route('PUT /user/', function () {
    $user = new user\src\User();
    $user->updateUserInfo();
});
Flight::route('POST /users/', function () {
    $user = new user\src\User();
    $user->batRegister();
});
Flight::route('GET /alluser/', function () {
    $user = new user\src\User();
    $user->getAllUser();
});
Flight::route('DELETE /users/', function () {
    $user = new user\src\User();
    $user->deleteUsers();
});
Flight::route('POST /session/', function () {
    $user = new user\src\User();
    $user->login();
});
Flight::start();
開發者ID:rgwybb,項目名稱:tars,代碼行數:31,代碼來源:index.php

示例7: function

Flight::route('/', function () {
    return Flight::view()->display('index.php', Flight::get('config')->getTemplateData());
});
// ! --- ROUTE: About ---------------------------
Flight::route('/we', function () {
    return Flight::get('config')->renderPage('about');
});
// ! --- ROUTE: Sitemap -------------------------
/**
 * Publishes all routes in the /sitemap.xml
 */
Flight::route('/sitemap.xml', function () {
    $items = Flight::get('navigation.loader')->getNavigationItems();
    $sitemap = array();
    foreach ($items as $item) {
        $sitemap[] = array('Url' => $item->get('Url'), 'DateTime' => $item->get('DateTime'));
    }
    Flight::response()->header('Content-Type', 'application/xml');
    Flight::view()->display('sitemap.php', array('Sitemap' => $sitemap));
});
// ! --- ROUTE: Project -------------------------
Flight::route('/@name', function ($name) {
    return Flight::get('config')->renderPage($name);
});
// ! --- ROUTE: 404 - Not Found -----------------
Flight::map('notFound', function () {
    Flight::view()->display('404.php', Flight::get('config')->getTemplateData());
    Flight::stop(404);
});
// ! --- Kick things off! -----------------------
Flight::start();
開發者ID:newmediakassel,項目名稱:website015,代碼行數:31,代碼來源:index.php

示例8: related

<?php

require_once 'vendor/autoload.php';
// Config views
Flight::set(array('flight.views.path' => './app', 'flight.views.extension' => '.html'));
class Api
{
    public static function related($id)
    {
        $headers = array("Accept" => "application/json");
        $url = "https://api.spotify.com/v1/artists/{$id}/related-artists";
        $related_artists = Unirest\Request::get($url, $headers)->body->artists;
        Flight::json($related_artists);
    }
    public static function toptrack($artist_id)
    {
        $headers = array("Accept" => "application/json");
        $url = "https://api.spotify.com/v1/artists/{$artist_id}/top-tracks?country=US";
        $artist_top_track = Unirest\Request::get($url, $headers)->body;
        Flight::json($artist_top_track);
    }
}
Flight::route('GET /', function () {
    Flight::render('index');
});
Flight::route('GET /api/related/@id', array('Api', 'related'));
Flight::route('GET /api/toptrack/@artist_id', array('Api', 'toptrack'));
Flight::start();
開發者ID:johnsylvain,項目名稱:spott,代碼行數:28,代碼來源:index.php

示例9: define

<?php

// Start a Session
if (!session_id()) {
    @session_start();
}
// define some constants for the project
define('PROJECT_FOLDER', '/');
define('EMAIL_TO', 'alejandro.mohamad@gmail.com');
// load libraries through composer
require_once 'vendor/autoload.php';
WingCommander::init();
Flight::set('flight.base_url', PROJECT_FOLDER);
// load dotenv
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
// routes
Flight::route('/', array('AcaSeDona\\Home', 'index'));
Flight::route('POST /send-place', array('AcaSeDona\\Home', 'save_place'));
Flight::route('/places', array('AcaSeDona\\Home', 'display_places'));
// Flight::route('POST /send-mail', array('AcaSeDona\Contact', 'send'));
Flight::route('/backend/places', array('AcaSeDona\\Backend', 'places'));
Flight::route('/backend/hide_place/@id', array('AcaSeDona\\Backend', 'hide_place'));
Flight::start();
開發者ID:j0an,項目名稱:AcaSeDona,代碼行數:24,代碼來源:index.php

示例10: function

<?php

//routes
/*
Flight::route('GET /', function(){
    return Flight::render('index');
});
*/
Flight::route('GET /', ['HomeController', 'index']);
開發者ID:ycrao,項目名稱:tinyme,代碼行數:9,代碼來源:routes.php

示例11: function

<?php

include 'flight/Flight.php';
include 'lib/lib.php';
// GET /urn
Flight::route('GET /urn', function () {
    echo '--';
});
// POST /urn
Flight::route('POST /urn/@urn', function ($urn) {
    $urnValid = isUrnValid($urn);
    // Build response
    $response = array();
    // Info
    $response['info'] = array();
    $response['info']['name'] = 'universal-document-server';
    $response['info']['version'] = '0.1';
    // Data
    $response['data'] = array();
    $response['data']['type'] = 'urnRequestResponse';
    $response['data']['requestedUrn'] = $urn;
    $response['data']['validated'] = $urnValid;
    $response['data']['message'] = '';
    header('Content-type: application/json');
    $jsonResponse = json_encode($response);
    echo $jsonResponse;
});
// Start
Flight::start();
開發者ID:universal-document,項目名稱:php-ud-server,代碼行數:29,代碼來源:index.php

示例12: function

<?php

require 'flight/Flight.php';
Flight::route('*', function () {
    Flight::render('hello.php');
});
Flight::start();
開發者ID:ebbynard,項目名稱:UGTV,代碼行數:7,代碼來源:index.php

示例13: function

<?php

require __DIR__ . '/database/bootEloquent.php';
Flight::set('flight.views.path', __DIR__ . '/views');
// routes
Flight::route('/', function () {
    Flight::render('hello.php', ['pessoas' => Pessoa::all()]);
});
Flight::route('POST /pessoas', function () {
    $pessoa = new Pessoa();
    $pessoa->nome = Flight::request()->data['nome'];
    $pessoa->save();
    Flight::redirect('/');
});
Flight::start();
開發者ID:neylsongularte,項目名稱:bootstrap-flight-microframework-php,代碼行數:15,代碼來源:run.php

示例14: array

<?php

// Index
Flight::route('/', array('IndexController', 'index'));
// Php Infos
Flight::route('/php-infos', array('IndexController', 'phpInfos'));
// Symfony Infos
Flight::route('/symfony', array('IndexController', 'symfony'));
// Majesteel Infos
Flight::route('/majesteel', array('IndexController', 'majesteel'));
開發者ID:purplebabar,項目名稱:whatdaserv,代碼行數:10,代碼來源:routing.php

示例15: session_start

session_start();
//главная страница
Flight::route('/(\\?p=@p)', function ($p) {
    $s_login = SetLogin();
    //gettin page index
    $page = 1;
    if ($p > 1) {
        $page = $p;
    }
    $postselector = ($page - 1) * 5;
    $posts = Flight::db()->GetPosts($postselector, 5);
    $postscount = Flight::db()->CountPosts();
    $pages_count = ceil($postscount / 5);
    Flight::render('home.php', array('headertext' => 'Мой летучий блог', 'authorname' => $s_login, 'footertext' => '@ProgForce forever'), 'home_page_content');
    Flight::render('post.php', array('posts' => $posts), 'posts_block');
    Flight::render('page_hyperlinks.php', array('pages_count' => $pages_count, 'current_page' => $page), 'pages_n_links');
    Flight::render('auth_view.php', null, 'auth_view');
    Flight::render('home_layout.php', null);
});
Flight::route('/exit', function () {
    session_destroy();
    Flight::redirect('/');
});
Flight::route('/auth/', function () {
    Flight::render('auth.php', null);
});
/*Flight::route('POST /authconfirm/', function()
		{ 
			Flight::render('authconfirm.php',array('post_args' => $_POST));
		});*/
Flight::start();
開發者ID:OlegBrezgalov,項目名稱:myflight,代碼行數:31,代碼來源:index.php


注:本文中的Flight::route方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。