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


PHP router::runpackage方法代碼示例

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


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

示例1:

<?php

/**
 * The local of this file is setted in the config file
 * This file can run route matches or can include another route file
 * For example i can run a route inside my app or inside packages
 */
//Run routing from app without prefix
//init the closure with the prefix fa
//This code is needed and you should not delete or modify
router::run('/app/' . APP_NAME . '/routing.php', '', $router);
//all the routes that run in this file are the routes that will be needed for all apps
//for routes that only are used by one specific app must be declared in the routing file inside the app
//Why this file exists? I think most of the routes are app specific...
//This file exist because the goal is multiapp framework, because of that i think a nice approach would be for example use the same backoffice for all apps
//in this case of the backoffice the routes for the backoffice are inserted in this file
// you cant run routes from multiple apps from one app, this is not permited and only makes the code confuse
// if you need to access stuff from another app then that stuff is aproved to be a package
// in the app i canot access another apps
// in the app i have full access to packages
router::runpackage('moonlight/auth', '', $router);
router::runpackage('moonlight/backoffice', 'bo', $router);
開發者ID:tandrezone,項目名稱:myframework,代碼行數:22,代碼來源:routing.php


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