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


PHP Lang::addNamespace方法代码示例

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


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

示例1: boot

 public function boot()
 {
     \Lang::addNamespace('core', __DIR__ . '/../Resources/lang');
     $this->registerConfig();
     $this->registerViews();
     $this->listenRoutes();
 }
开发者ID:pingpongcms,项目名称:core,代码行数:7,代码来源:CoreServiceProvider.php

示例2: addNamespaces

 /**
  * Adding new namespaces for all registered modules.
  *
  * @return void
  */
 public function addNamespaces()
 {
     $path = $this->path;
     foreach ($this->all() as $key => $name) {
         \Lang::addNamespace($name, $path . $name . '/lang');
     }
 }
开发者ID:acmadi,项目名称:modules,代码行数:12,代码来源:Module.php

示例3: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('cednet/cms');
     $this->workbenchPath = __DIR__ . '/../..';
     include __DIR__ . '/../../routes_cms.php';
     \View::addNamespace('cms', __DIR__ . '/../../views');
     \Lang::addNamespace('cms', __DIR__ . '/../../lang');
 }
开发者ID:cednet,项目名称:laravel-cms-addon,代码行数:13,代码来源:CmsServiceProvider.php

示例4: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('jeroen-g/laravel-photo-gallery', 'gallery');
     // Views will first be sought in app/views/gallery before the package view is used.
     \View::addNamespace('gallery', app_path() . '/views/gallery');
     \View::addNamespace('gallery', __DIR__ . '/../../views');
     // Shortcut for using the gallery language lines.
     \Lang::addNamespace('gallery', __DIR__ . '/../../lang');
     include __DIR__ . '/../../routes.php';
 }
开发者ID:DrudgeRajen,项目名称:laravel-photo-gallery,代码行数:15,代码来源:LaravelPhotoGalleryServiceProvider.php

示例5: __construct

 function __construct($module)
 {
     if (!session_id()) {
         session_start();
     }
     // set Custom Pagination
     Config::set('view.pagination', 'frontend.partial.pagination');
     //set Theme
     $this->theme = Config::get('frontend.theme');
     // set module
     $this->module = $module;
     // no use layout master when ajax
     if (Request::ajax()) {
         $this->layout = null;
     }
     View::share('assetURL', 'frontend/theme/' . $this->theme . '/assets/');
     // add Location View
     View::addLocation(base_path() . '/frontend/theme/' . $this->theme . '/views/' . $this->module);
     View::addLocation(base_path() . '/frontend/theme/' . $this->theme . '/views');
     // add Lang
     Lang::addNamespace($this->module, base_path() . '/frontend/modules/' . $this->module . '/lang');
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:22,代码来源:FrontendController.php

示例6:

<?php

/*
|--------------------------------------------------------------------------
| Register Namespaces And Routes
|--------------------------------------------------------------------------
|
| When a module starting, this file will executed automatically. This helps
| to register some namespaces like translator or view. Also this file
| will load the routes file for each module. You may also modify
| this file as you want.
|
*/
Lang::addNamespace('agreement', __DIR__ . '/Resources/lang');
View::addNamespace('agreement', __DIR__ . '/Resources/views');
require __DIR__ . '/Http/routes.php';
开发者ID:hilmysyarif,项目名称:sisfito,代码行数:16,代码来源:start.php

示例7: function

 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public license for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @category	FluxBB
 * @package		Core
 * @copyright	Copyright (c) 2008-2012 FluxBB (http://fluxbb.org)
 * @license		http://www.gnu.org/licenses/gpl.html	GNU General Public License
 */
View::addNamespace('fluxbb', __DIR__ . '/views/');
Lang::addNamespace('fluxbb', __DIR__ . '/language/');
Route::group(array('NOTbefore' => 'fluxbb::is_installed'), function () {
    Route::get('forum/{fid}', array('as' => 'viewforum', 'uses' => 'FluxBB\\Controllers\\Home@get_forum'));
    Route::get('topic/{tid}', array('as' => 'viewtopic', 'uses' => 'FluxBB\\Controllers\\Home@get_topic'));
    Route::get('post/{pid}', array('as' => 'viewpost', 'uses' => 'FluxBB\\Controllers\\Home@get_post'));
    Route::get('/', array('as' => 'index', 'uses' => 'FluxBB\\Controllers\\Home@get_index'));
    Route::get('profile/{uid}/{username}', array('as' => 'profile', 'uses' => 'FluxBB\\Controllers\\User@get_profile'));
    Route::put('profile/{uid}/{username}', array('uses' => 'FluxBB\\Controllers\\User@put_profile'));
    Route::get('user/list', array('as' => 'userlist', 'uses' => 'FluxBB\\Controllers\\User@get_list'));
    Route::get('register', array('as' => 'register', 'uses' => 'FluxBB\\Controllers\\Auth@get_register'));
    Route::post('register', array('uses' => 'FluxBB\\Controllers\\Auth@post_register'));
    Route::get('login', array('as' => 'login', 'uses' => 'FluxBB\\Controllers\\Auth@get_login'));
    Route::post('login', array('uses' => 'FluxBB\\Controllers\\Auth@post_login'));
    Route::get('logout', array('as' => 'logout', 'uses' => 'FluxBB\\Controllers\\Auth@get_logout'));
    Route::get('rules', array('as' => 'rules', 'uses' => 'FluxBB\\Controllers\\Misc@get_rules'));
    Route::get('search', array('as' => 'search', 'uses' => 'FluxBB\\Controllers\\Search@get_index'));
开发者ID:nathanking101,项目名称:core,代码行数:31,代码来源:routes.php

示例8: app_path

| In order to keep larapress completely isolated from your application
| we require an extra start file here. This allows you updating larapress
| with no worries about breaking your code.
|
*/
require app_path() . '/Larapress/start.php';
/*
|--------------------------------------------------------------------------
| Namespace The Larapress Views
|--------------------------------------------------------------------------
|
| In order to keep larapress completely isolated from your application we
| are using our own namespaced views directory. This also comes in handy
| if you want to apply your own theme to larapress. (You could just
| duplicate app/Larapress/Views/* and change the directory below)
|
*/
View::addNamespace('larapress', __DIR__ . '/../Larapress/Views');
/*
|--------------------------------------------------------------------------
| Namespace The Larapress Lang Files
|--------------------------------------------------------------------------
|
| In order to keep larapress completely isolated from your application we
| are using our own namespaced lang directory. This also comes in handy
| if you want to apply your own translations to larapress. (You could just
| duplicate app/Larapress/Lang/* and change the directory below)
|
*/
Lang::addNamespace('larapress', __DIR__ . '/../Larapress/Lang');
开发者ID:LaraGit,项目名称:larapress,代码行数:30,代码来源:global.php

示例9: foreach

    Config::set("cms.auto_settings", $auto_settings);
    Config::set("cms.themes.data", $themes);
    Config::set("cms.themes.installed", $themesInstalled);
    Config::set("cms.themes.not_installed", $themesNotInstalled);
    foreach ($addons as $addon) {
        if ($addon->installed == 1) {
            $addonsInstalled[] = $addon->addon_name;
            if (file_exists(public_path() . "/addons/{$addon->addon_name}/routes.php")) {
                require public_path() . "/addons/{$addon->addon_name}/routes.php";
            }
            if (file_exists(public_path() . "/addons/{$addon->addon_name}/func.php")) {
                require public_path() . "/addons/{$addon->addon_name}/func.php";
            }
            $namespace = $addon->addon_name;
            $path = public_path() . "/addons/{$addon->addon_name}/lang";
            Lang::addNamespace($namespace, $path);
        } else {
            $addonsNotInstalled[] = $addon->addon_name;
        }
    }
    Config::set("cms.addons.data", $addons);
    Config::set("cms.addons.installed", $addonsInstalled);
    Config::set("cms.addons.not_installed", $addonsNotInstalled);
    if (Session::has('currlang')) {
        Config::set('cms.currlang', Session::get('currlang'));
    } else {
        $lang = Languages::where("code", "=", Config::get('cms.currlang'))->first();
        Config::set('cms.currlang', array('code' => $lang->code, 'title' => $lang->title, 'image' => $lang->image));
    }
});
App::after(function ($request, $response) {
开发者ID:basdog22,项目名称:laracms_nopublic,代码行数:31,代码来源:filters.php

示例10: boot

 public function boot()
 {
     \Lang::addNamespace('api', __DIR__ . '/../Resources/lang');
     \View::addNamespace('api', __DIR__ . '/../Resources/views');
 }
开发者ID:pingpongcms,项目名称:api,代码行数:5,代码来源:ApiServiceProvider.php

示例11: public_path

<?php

Lang::addNamespace('stream', public_path('plugins/streaming/plugin/lang'));
//register plugin routes
require public_path() . '/plugins/streaming/plugin/routes.php';
//register a filter for links
Route::filter('links', function ($route, $request, $value) {
    if (!is_string($value)) {
        App::Abort(403);
    }
    if (!Helpers::hasAccess("links.{$value}")) {
        return Redirect::to('/');
    }
});
//make sure laravel can find and load plugin views
View::addLocation(public_path('plugins/streaming/plugin/views'));
//override mtdb controllers
App::bind('DashboardController', function () {
    return new StreamingDashboardController();
});
App::bind('SeriesSeasonsController', function () {
    return new StreamingSeriesSeasonsController();
});
App::bind('SeasonsEpisodesController', function () {
    return new StreamingSeasonsEpisodesController();
});
//override other classes
App::bind('Lib\\Repository', function () {
    return new Plugins\Streaming\Plugin\Lib\Repository();
});
App::bind('Lib\\Titles\\TitleRepository', function () {
开发者ID:onlystar1991,项目名称:mtdb,代码行数:31,代码来源:start.php

示例12: __construct

 public function __construct($module, $layout)
 {
     if (session_id() == '') {
         @session_start();
     }
     //CUSTOM PAGINATION BACKEND
     Config::set('view.pagination', 'partials.pagination');
     // set section name by segment
     $this->section = Request::segment(2);
     // set folder name of section
     $this->sectionFolder = str_replace("-", "_", $this->section);
     // set user
     $this->user = Sentry::getUser();
     if ($this->user) {
         $this->beforeFilter(function () {
             if (!$this->checkUserSection()) {
                 return $this->logout();
             }
         });
     }
     // set module name
     $this->moduleName = $module;
     // share global module route prefix
     View::share('moduleRoutePrefix', Str::studly($module));
     // set module name by segment
     $this->moduleSegment = Request::segment(3);
     // set folder name of module
     $this->moduleFolder = str_replace("-", "_", $this->moduleName);
     // set url of module
     $this->moduleURL = URL::to('/') . '/' . Config::get('backend.uri') . '/' . $this->section . '/' . $this->moduleSegment . '/';
     // set theme
     $this->theme = Config::get('backend.theme');
     // set asset url
     $this->assetURL = url() . '/backend/theme/' . $this->theme . '/assets/';
     // set view path for autoload
     View::addLocation(base_path() . '/backend/theme/' . $this->theme . '/views/' . $this->sectionFolder . '/' . $this->moduleFolder);
     View::addLocation(base_path() . '/backend/theme/' . $this->theme . '/views/' . $this->sectionFolder);
     View::addLocation(base_path() . '/backend/theme/' . $this->theme . '/views/general');
     View::addLocation(base_path() . '/backend/theme/' . $this->theme . '/views');
     // set asset url for all view
     View::share('assetURL', $this->assetURL);
     // Set lang namespace
     Lang::addNamespace("backend", base_path() . '/backend/lang');
     Lang::addNamespace($this->moduleSegment, base_path() . '/backend/modules/' . $this->moduleFolder . '/lang');
     // no use layout master when ajax
     if (Request::ajax()) {
         $this->layout = null;
     } else {
         $this->layout = View::make($layout);
     }
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:51,代码来源:BackendController.php

示例13:

<?php

/*
|--------------------------------------------------------------------------
| Register The Module Namespaces
|--------------------------------------------------------------------------
|
| Here is you can register the namespace for this module.
| You may to edit this namespace if you want.
|
*/
View::addNamespace('blog', __DIR__ . '/Resources/views/');
Lang::addNamespace('blog', __DIR__ . '/Resources/lang/');
Config::addNamespace('blog', __DIR__ . '/Config/');
/*
|--------------------------------------------------------------------------
| Require Routes File.
|--------------------------------------------------------------------------
|
| Next, this module will load routes file.
|
*/
require __DIR__ . '/Http/routes.php';
开发者ID:chronokz,项目名称:modules,代码行数:23,代码来源:start.php

示例14:

| Register The Module Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(__DIR__ . '/../commands', __DIR__ . '/../controllers', __DIR__ . '/../models', __DIR__ . '/../database/seeds'));
/*
|--------------------------------------------------------------------------
| Register The Module Namespaces
|--------------------------------------------------------------------------
|
| Here is you can register the namespace for this module.
| You may to edit this namespace if you want.
|
*/
View::addNamespace('usermanage', __DIR__ . '/../views/');
Lang::addNamespace('usermanage', __DIR__ . '/../lang/');
Config::addNamespace('usermanage', __DIR__ . '/../config/');
/*
|--------------------------------------------------------------------------
| Require Module Filters and Routes file.
|--------------------------------------------------------------------------
|
| Next, this module will load filters and routes file.
|
*/
require __DIR__ . '/../filters.php';
require __DIR__ . '/../routes.php';
开发者ID:hilmysyarif,项目名称:laravel-easyui,代码行数:31,代码来源:global.php


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