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


PHP Lobby::setTitle方法代码示例

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


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

示例1: setTitle

 public function setTitle($title)
 {
     \Lobby::setTitle("{$title} | {$this->name}");
 }
开发者ID:saviobosco,项目名称:lobby,代码行数:4,代码来源:App.php

示例2: defaults

 /**
  * Define some pages by default
  */
 public static function defaults()
 {
     /**
      * Route App Pages (/app/{appname}/{page}) to according apps
      */
     self::route("/app/[:appID]?/[**:page]?", function ($request) {
         $AppID = $request->appID;
         $GLOBALS['AppID'] = $AppID;
         $page = $request->page != "" ? "/{$request->page}" : "/";
         /**
          * Check if App exists
          */
         $App = new \Lobby\Apps($AppID);
         if ($App->exists && $App->isEnabled() && substr($page, 0, 7) != "/Admin/") {
             $class = $App->run();
             $AppInfo = $App->info;
             /**
              * Set the title
              */
             \Lobby::setTitle($AppInfo['name']);
             /**
              * Add the App item to the navbar
              */
             \Lobby\UI\Panel::addTopItem("lobbyApp{$AppID}", array("text" => $AppInfo['name'], "href" => APP_URL, "position" => "left"));
             $page_response = $class->page($page);
             if ($page_response == "auto") {
                 if ($page == "/") {
                     $page = "/index";
                 }
                 $GLOBALS['workspaceHTML'] = $class->inc("/src/Page{$page}.php");
             } else {
                 $GLOBALS['workspaceHTML'] = $page_response;
             }
             if ($GLOBALS['workspaceHTML'] == null) {
                 ser();
             }
         } else {
             ser();
         }
     });
     /**
      * Dashboard Page
      * The main Page. Add CSS & JS accordingly
      */
     self::route("/", function () {
         \Lobby::setTitle("Dashboard");
         \Lobby\UI\Themes::loadDashboard("head");
         $GLOBALS['workspaceHTML'] = array("/includes/lib/core/Inc/dashboard.php");
     });
     /**
      * Administration
      */
     self::route("/admin/app/[:appID]?/[**:page]?", function ($request) {
         $AppID = $request->appID;
         $GLOBALS['AppID'] = $AppID;
         $page = $request->page != "" ? "/Admin/{$request->page}" : "/Admin/index";
         /**
          * Check if App exists
          */
         $App = new \Lobby\Apps($AppID);
         if ($App->exists && $App->isEnabled()) {
             /**
              * Redirect /src/ files to App's Source in /contents folder
              */
             $class = $App->run();
             $AppInfo = $App->info;
             /**
              * Set the title
              */
             \Lobby::setTitle($AppInfo['name']);
             /**
              * Add the App item to the navbar
              */
             \Lobby\UI\Panel::addTopItem("lobbyApp{$AppID}", array("text" => "Admin > " . $AppInfo['name'], "href" => "/admin/app/{$AppID}", "position" => "left"));
             $page_response = $class->page($page);
             if ($page_response == "auto") {
                 if ($page == "/") {
                     $page = "/index";
                 }
                 $GLOBALS['workspaceHTML'] = $class->inc("/src/Page{$page}.php");
             } else {
                 $GLOBALS['workspaceHTML'] = $page_response;
             }
             if ($GLOBALS['workspaceHTML'] === false || $GLOBALS['workspaceHTML'] == null) {
                 ob_start();
                 ser("Error", "The app '<strong>{$AppID}</strong>' does not have an Admin Page");
                 $error = ob_get_contents();
                 ob_end_clean();
                 $GLOBALS['workspaceHTML'] = "<div class='contents'>" . $error . "</div>";
             }
         }
     });
 }
开发者ID:saviobosco,项目名称:lobby,代码行数:96,代码来源:Router.php


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