本文整理汇总了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();
}
示例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');
}
}
示例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');
}
示例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';
}
示例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');
}
示例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';
示例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'));
示例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');
示例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) {
示例10: boot
public function boot()
{
\Lang::addNamespace('api', __DIR__ . '/../Resources/lang');
\View::addNamespace('api', __DIR__ . '/../Resources/views');
}
示例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 () {
示例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);
}
}
示例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';
示例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';