本文整理汇总了PHP中resource_path函数的典型用法代码示例。如果您正苦于以下问题:PHP resource_path函数的具体用法?PHP resource_path怎么用?PHP resource_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resource_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFolder
private function generateFolder($data, $moduleName, $path, $filepath = null)
{
foreach ($data as $basefolder => $subfolders) {
$generateFolder = app_path() . '/Modules/' . $moduleName . '/' . $path . '/' . $basefolder . '/ ';
$this->makeDirectory($generateFolder);
$this->warn("+ Directory Generated:\t" . $generateFolder);
$mPath = app_path() . '/Modules/' . $moduleName . '/';
if ($this->optionalStubPath != "") {
//$stubPath = __DIR__.'/stubs/'.$path.$basefolder;
//$stubPathDirectory = __DIR__.'/stubs/';
$stubPath = resource_path("stubs/" . $this->optionalStubPath . '/stubs/' . $path . $basefolder);
$stubPathDirectory = resource_path("stubs/" . $this->optionalStubPath . '/stubs/');
} else {
$stubPath = __DIR__ . '/stubs/' . $path . $basefolder;
$stubPathDirectory = __DIR__ . '/stubs/';
}
// Module Files
foreach ((array) $this->findFiles($stubPathDirectory) as $file) {
$this->generateFile($file, $moduleName, $mPath, $stubPathDirectory);
}
// Module Directory Files
foreach ((array) $this->findFiles($stubPath) as $file) {
$this->generateFile($file, $moduleName, $generateFolder, $stubPath);
}
// Module Directory Folders (loop)
if (isset($subfolders)) {
$this->generateFolder($subfolders, $this->moduleName, $path . '/' . $basefolder . '/');
}
}
}
示例2: boot
/**
* Bootstrap the application services.
*/
public function boot(Router $router, ViewFactory $view)
{
$view->addNamespace('admin', resource_path('views/admin'));
// route model binding for admin routes
$router->model('content_page', Page::class);
$this->bootAdminRoutes($router);
}
示例3: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/resources/views', 'pagination');
if ($this->app->runningInConsole()) {
$this->publishes([__DIR__ . '/resources/views' => resource_path('views/vendor/pagination')], 'laravel-pagination');
}
}
示例4: larapackage
function larapackage($package, $alias = null)
{
if (!$alias) {
$alias = $package;
}
//если назначена кастомная тема оформления
if ($theme = PageTheme::getCurrent()) {
/// если переопределены шаблоны вьюх для указанной темы
$theme_views_dir = base_path('vendor/' . $package . '/src/views/!/themes/' . $theme);
if (file_exists($theme_views_dir)) {
$this->loadViewsFrom($theme_views_dir, $alias);
}
}
//базовые шаблоны пакета
$view_dir = base_path('vendor/' . $package . '/src/views');
if (file_exists($view_dir)) {
$this->loadViewsFrom($view_dir, $alias);
}
//базовые шаблоны пакета
$lang_dir = base_path('vendor/' . $package . '/src/lang');
if (file_exists($lang_dir)) {
$this->loadTranslationsFrom($lang_dir, $alias);
$this->publishes([$lang_dir => resource_path('lang/vendor/' . $alias)]);
}
//регистрируем миграции
if (is_dir(base_path('vendor/' . $package . '/src/migrations'))) {
$this->publishes([base_path('vendor/' . $package . '/src/migrations') => base_path('database/migrations')], 'migrations');
}
$this->bootPackage($package);
}
示例5: layout_version
function layout_version($layout = 'main')
{
$get_hash = function ($layout) {
$hash = '';
$files = [public_path('assets/css/app.css'), public_path('assets/js/app.js'), resource_path('views/layouts/main.blade.php'), resource_path('views/partials/header.blade.php'), resource_path('views/partials/footer.blade.php')];
if ($layout != 'main') {
$files[] = resource_path('views/layouts/' . str_replace('.', DIRECTORY_SEPARATOR, $layout) . '.blade.php');
}
foreach ($files as $file) {
$hash .= hash_file('md5', $file);
}
return hash('md5', $hash);
};
if (App::environment('local', 'development', 'staging')) {
if (!($hash = config('version.layout.' . $layout))) {
$hash = $get_hash($layout);
config(compact('hash'));
}
} else {
$hash = Cache::remember('version.layout.' . $layout, config('version.cache_duration', 5), function () use($get_hash, $layout) {
return $get_hash($layout);
});
}
return $hash;
}
示例6: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot(Router $router)
{
$router->middleware('roles', \App\Http\Middleware\HasRole::class);
$router->middleware('admin', \App\Http\Middleware\AdminMiddleware::class);
if (!$this->app->routesAreCached()) {
require __DIR__ . '/Http/routes.php';
}
$configFiles = ['acl'];
foreach ($configFiles as $config) {
$this->mergeConfigFrom(__DIR__ . "/config/{$config}.php", 'acl');
}
$this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'acl');
$this->loadViewsFrom(__DIR__ . '/resources/views', 'acl');
//Publish middleware
$this->publishes([__DIR__ . '/Middleware/' => app_path('Http/Middleware')]);
//Publish providers
$this->publishes([__DIR__ . '/Providers/' => app_path('Providers')]);
//Publish views
$this->publishes([__DIR__ . '/resources/views' => resource_path('views')], 'views');
//Publish translations
$this->publishes([__DIR__ . '/resources/lang/' => resource_path('lang/')], 'translations');
// Publish a config file
$this->publishes([__DIR__ . '/config/acl.php' => config_path('acl.php')], 'config');
//Publish migrations
$this->publishes([__DIR__ . '/database/migrations' => database_path('migrations'), __DIR__ . '/database/seeds' => database_path('seeds')], 'migrations');
$this->publishes([__DIR__ . '/assets/bower_components/AdminLTE/' => public_path('/assets/bower_components/AdminLTE/')], 'public');
$this->publishes([__DIR__ . '/Http/Controllers/Auth/' => app_path('/Http/Controllers/Auth/'), __DIR__ . '/Http/Controllers/Admin/' => app_path('/Http/Controllers/Admin/')], 'controllers');
$this->publishes([__DIR__ . '/Models/Admin/' => app_path()], 'models');
}
示例7: register
public function register()
{
$this->publishes([__DIR__ . '/../database/seeds/' => database_path('seeds')], 'seeds');
$this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations');
$this->publishes([__DIR__ . '/../app/' => app_path()], 'app');
$this->publishes([__DIR__ . '/../resources/views/' => resource_path('views')], 'views');
}
开发者ID:unstoppablecarl,项目名称:laravel-content-pages-example,代码行数:7,代码来源:PagesExampleInstallerServiceProvider.php
示例8: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
if (!$this->app->routesAreCached()) {
require __DIR__ . '/Http/routes.php';
}
$configFiles = ['job'];
foreach ($configFiles as $config) {
$this->mergeConfigFrom(__DIR__ . "/config/{$config}.php", 'job_market_manager');
}
$this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'job_market_manager');
$this->loadViewsFrom(__DIR__ . '/resources/views', 'job_market_manager');
//Publish middleware
// $this->publishes([
// __DIR__ . '/Middleware/' => app_path('Http/Middleware'),
// ]);
//Publish providers
// $this->publishes([
// __DIR__ . '/Providers/' => app_path('Providers'),
// ]);
//Publish views
$this->publishes([__DIR__ . '/resources/views' => resource_path('views')], 'views');
//Publish translations
$this->publishes([__DIR__ . '/resources/lang/' => resource_path('lang/')], 'translations');
// Publish a config file
$this->publishes([__DIR__ . '/config/job.php' => config_path('job.php')], 'config');
//Publish migrations
$this->publishes([__DIR__ . '/database/migrations' => database_path('migrations')], 'migrations');
// $this->publishes([
// __DIR__.'/assets/bower_components/AdminLTE/' => public_path('/assets/bower_components/AdminLTE/'),
// ], 'public');
$this->publishes([__DIR__ . '/Http/Controllers/Admin/' => app_path('/Http/Controllers/Admin/')], 'controllers');
$this->publishes([__DIR__ . '/Models/Admin/' => app_path()], 'models');
}
示例9: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$this->publishes([__DIR__ . '/../config/shows.php/' => config_path('shows.php')], 'config');
$this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations');
$this->loadViewsFrom(__DIR__ . '/../resources/views', 'shows');
$this->publishes([__DIR__ . '/../resources/views' => resource_path('views/vendor/shows')]);
}
示例10: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->loadViewsFrom($this->getViewsPath(), 'flash');
$this->publishes([$this->getViewsPath() => resource_path('views/vendor/flash')]);
$this->publishes([$this->getSassPath() => resource_path('/assets/sass/vendor')]);
$this->publishes([$this->getJavascriptPath() => resource_path('/assets/js/components')]);
}
示例11: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
if (!$this->app->routesAreCached()) {
require __DIR__ . '/routes.php';
}
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Frontend\\NewsletterController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Frontend\\InscriptionController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\NewsletterController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\CampagneController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ContentController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\SendController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\SubscriberController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ImportController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ListController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\EmailController');
$this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ClipboardController');
$this->publishes([__DIR__ . '/database/migrations/' => database_path('migrations')], 'migrations');
$this->publishes([__DIR__ . '/database/seeds' => base_path('database/seeds')], 'seeds');
$this->publishes([__DIR__ . '/config/newsletter.php' => config_path('newsletter.php')], 'config');
$this->publishes([__DIR__ . '/assets' => public_path('newsletter')], 'assets');
$this->loadViewsFrom(__DIR__ . '/views', 'newsletter');
$this->publishes([__DIR__ . '/views' => resource_path('views/vendor/newsletter')], 'views');
$this->publishes([__DIR__ . '/views/Backend/layouts' => resource_path('views/vendor/newsletter/Backend/layouts')], 'layouts');
$this->app['validator']->extend('emailconfirmed', function ($attribute, $value, $parameters) {
$email = \DB::table('newsletter_users')->where('email', '=', $value)->first();
if ($email) {
return !$email->activated_at ? false : true;
}
return false;
});
}
示例12: boot
/**
* {@inheritdoc}
*/
public function boot()
{
// The assets path.
$assets = __DIR__ . '/../resources/assets/';
// The views path.
$views = __DIR__ . '/../resources/views/';
// The controllers path.
$controllers = __DIR__ . '/Http/Controllers/';
// The presenters path.
$presenters = __DIR__ . '/Http/Presenters/';
// The requests path.
$requests = __DIR__ . '/Http/Requests/';
// The middleware path.
$middleware = __DIR__ . '/Http/Middleware/';
// The administration routes file.
$routes = __DIR__ . '/Http/administration.php';
// The models path.
$models = __DIR__ . '/Models/';
// The exceptions path.
$exceptions = __DIR__ . '/Exceptions/';
// The processors path.
$processors = __DIR__ . '/Processors/';
// The providers path.
$providers = __DIR__ . '/Providers/';
// The jobs path.
$jobs = __DIR__ . '/Jobs/';
// The migrations path.
$migrations = __DIR__ . '/Migrations/';
// The authorization tag.
$tag = 'administration';
// Add all publishable scaffolding.
$this->publishes([$assets => public_path(), $views => resource_path('views'), $controllers => app_path('Http/Controllers'), $presenters => app_path('Http/Presenters'), $requests => app_path('Http/Requests'), $middleware => app_path('Http/Middleware'), $routes => app_path('Http/administration.php'), $models => app_path('Models'), $exceptions => app_path('Exceptions'), $processors => app_path('Processors'), $providers => app_path('Providers'), $jobs => app_path('Jobs'), $migrations => database_path('migrations')], $tag);
}
示例13: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->publishes([__DIR__ . '/../../config/apiutils.php' => config_path('apiutils.php')]);
$this->publishes([__DIR__ . '/../../config/routeparamsmapping.php' => config_path('routeparamsmapping.php')]);
$this->loadTranslationsFrom(__DIR__ . '/../../resources/lang/', 'apiutils');
$this->publishes([__DIR__ . '/../../resources/lang/' => resource_path('lang/vendor/apiutils')]);
}
示例14: handle
public function handle()
{
$generator = (require resource_path('crud/generator.php'));
foreach ($generator as $name => $config) {
Artisan::call('crud:generate', $this->buildOptions($name, $config));
}
}
示例15: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot(Router $router)
{
$this->loadViewsFrom(__DIR__ . '/views', 'jiracal');
$this->publishes([__DIR__ . '/views' => resource_path('views/vendor/jiracal')], 'views');
$this->publishes([__DIR__ . '/config/jiracal.php' => config_path('jiracal.php')], 'config');
parent::boot($router);
}