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


PHP View::addLocation方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->now = date("Y/m/d H:i:s");
     $this->ConfigFolder = realpath(__DIR__ . '/../../../config/banks/' . $this->drivername . '/');
     $this->bankConfig = \Config::get('Payby::banks\\' . $this->drivername . '\\config.info');
     \View::addLocation($this->ConfigFolder);
     \View::addNamespace('Payby', $this->ConfigFolder);
 }
开发者ID:miladr,项目名称:payby,代码行数:8,代码来源:DriverAbstract.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     View::addLocation(__DIR__ . '/../views');
     Route::get('user/{id}', ['as' => 'get_user', function ($id) {
         return $id;
     }]);
     Route::get('comment/{id}', ['as' => 'get_comment', function ($id) {
         return $id;
     }]);
     Route::get('post/{id}', ['as' => 'get_post', function ($id) {
         return $id;
     }]);
 }
开发者ID:leeduc,项目名称:json-api-builder,代码行数:14,代码来源:TestCase.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     View::addLocation(__DIR__ . '/fixtures/views');
     $this->controllerName = "AcProjectsController";
     $this->modelName = "AcProject";
     $this->modelAttributes = ['id' => 5, 'name' => 'Test AuthorityController package', 'priority' => 1];
     $this->resourceName = "ac_projects";
     // str_plural(snake_case($this->modelName));
     Route::resource($this->resourceName, $this->controllerName);
     $this->userAttributes = ['id' => 1, 'username' => 'tortue', 'firstname' => 'Tortue', 'lastname' => 'Torche', 'email' => 'tortue.torche@spam.me', 'password' => Hash::make('tortuetorche'), 'displayname' => 'Tortue Torche'];
     $this->user = $this->getUserWithRole('admin');
     $this->authority = $this->getAuthority($this->user);
     $this->authority->allow('manage', $this->modelName);
 }
开发者ID:efficiently,项目名称:authority-controller,代码行数:15,代码来源:AcProjectsControllerTest.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $agent = new Agent();
     // Определяем устройство и устанавливаем пути к js контроллерам и видам
     if ($agent->isMobile()) {
         \Config::set('js-controllers.path_controllers', 'dist/main/ng');
         \Config::set('js-controllers.path_js_files', 'dist/main/js');
         \View::addLocation(realpath(base_path('resources/views/mobile')));
     } else {
         \Config::set('js-controllers.path_controllers', 'dist/main/ng');
         \Config::set('js-controllers.path_js_files', 'dist/main/js');
         \View::addLocation(realpath(base_path('resources/views/desktop')));
     }
     return $next($request);
 }
开发者ID:Snikius,项目名称:example,代码行数:22,代码来源:ThemeDetector.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: it_retrieves_the_mesage_id_from_ses

 /**
  * @test
  *
  * Note that to complete this test, you must have aws credentials as well as a valid
  * from address in the mail config.
  */
 public function it_retrieves_the_mesage_id_from_ses()
 {
     if (!config('aws.credentials.key') || config('mail.from.address') == null) {
         $this->markTestIncomplete();
         return;
     }
     Config::set('mail.driver', 'ses');
     (new Illuminate\Mail\MailServiceProvider(app()))->register();
     // Must re-register the MailTracker to get the test to work
     $this->app['mailer']->getSwiftMailer()->registerPlugin(new MailTracker());
     $faker = Faker\Factory::create();
     $email = 'success@simulator.amazonses.com';
     $subject = $faker->sentence;
     $name = $faker->firstName . ' ' . $faker->lastName;
     \View::addLocation(__DIR__);
     \Mail::send('email.test', [], function ($message) use($email, $subject, $name) {
         $message->to($email, $name);
         $message->replyTo('reply-to@johndoe.com', 'Reply-To Name');
         $message->subject($subject);
         $message->priority(3);
     });
     $sent_email = \jdavidbakr\MailTracker\Model\SentEmail::orderBy('id', 'desc')->first();
     $this->assertEquals(0, preg_match('/swift\\.generated/', $sent_email->message_id));
 }
开发者ID:jdavidbakr,项目名称:mail-tracker,代码行数:30,代码来源:MailTrackerTest.php

示例7: adsProcess


//.........这里部分代码省略.........
                                                 if ($deliveryStatus == Delivery::DELIVERY_STATUS_OVER_REPORT) {
                                                     $data['ovr'] = $isOverReport = true;
                                                 }
                                                 $responseType = Delivery::RESPONSE_TYPE_ADS_SUCCESS;
                                                 // update number show retargeting
                                                 $url = $flight->retargeting_url;
                                                 if ($url != "") {
                                                     $campaign = $deliveryModel->getCampaign($flight->campaign_id);
                                                     $tracking = new Tracking();
                                                     $key = "Retargeting:{$campaign->advertiser_id}:{$tracking->getVisitorId()}";
                                                     $cache = RedisHelper::get($key);
                                                     if (isset($cache->{$url})) {
                                                         $keyNumberTarget = "RetargetingNumber:{$campaign->advertiser_id}:{$flight->id}:{$flight->ad_id}:{$tracking->getVisitorId()}";
                                                         $cacheNumberTarget = RedisHelper::get($keyNumberTarget);
                                                         if ($cacheNumberTarget) {
                                                             RedisHelper::increment($keyNumberTarget);
                                                         } else {
                                                             RedisHelper::set($keyNumberTarget, 1);
                                                         }
                                                     }
                                                 }
                                                 break;
                                             }
                                         }
                                     }
                                 }
                                 //endforeach
                             }
                             //no ads available
                             if ($responseType != Delivery::RESPONSE_TYPE_ADS_SUCCESS) {
                                 $responseType = Delivery::RESPONSE_TYPE_NOT_AVAILABLE;
                             }
                         } else {
                             $responseType = Delivery::RESPONSE_TYPE_REFERRER_NOT_MATCH;
                         }
                     }
                 }
             }
         }
     }
     //invalid ads request
     if (empty($responseType)) {
         $responseType = Delivery::RESPONSE_TYPE_INVALID;
     } elseif ($responseType == Delivery::RESPONSE_TYPE_ADS_SUCCESS) {
         $expandFields = array('flight_id' => $flightWebsite->flight_id, 'ad_format_id' => $adZone->ad_format_id, 'ad_id' => $flight->ad_id, 'campaign_id' => $flight->campaign_id, 'publisher_ad_zone_id' => $adZone->id, 'flight_website_id' => $flightWebsite->id, 'website_id' => $flightWebsite->website_id);
         if ($isOverReport) {
             $expandFields['ovr'] = 1;
         }
         $expandFields['checksum'] = $checksum = $trackingModel->makeChecksumHash($flightWebsite->id, $trackingModel->created_at);
         $eventChecksum = Delivery::RESPONSE_TYPE_ADS_SUCCESS;
         $trackingModel->setChecksumTrackingEvent($checksum, Delivery::RESPONSE_TYPE_ADS_SUCCESS);
         (new RawTrackingSummary())->addSummary('ads_request', $flightWebsite->website_id, $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flight->ad_id, $flight->campaign_id);
     }
     //serve Ad
     // if(0){
     if (!empty($serveAd)) {
         View::addLocation(base_path() . '/frontend/theme/default/views/delivery');
         if (isset($data['ec'])) {
             if ($data['ec'] == 1) {
                 $data['checksum'] = $expandFields['checksum'];
                 $this->data['data'] = $data;
                 $data['type'] = $serveAd->ad_view ? $serveAd->ad_view : strtolower($data['type']);
                 if (Input::get('test') == 1) {
                     return View::make($data['type'], $this->data);
                 } else {
                     $response = Response::view($data['type'], $this->data)->header('Content-Type', 'text/javascript; charset=UTF-8');
                 }
             } else {
                 $response = $vast->makeVAST($data['aid'], $data['fpid'], $data['zid'], $expandFields['checksum'], $isOverReport);
             }
         }
     } else {
         //TO DO : return backup ads
         if (!empty($adZone)) {
             $alternateAds = $deliveryModel->getAlternateAds($adZone->id);
             if (isset($adZone) && $alternateAds) {
                 if (isset($data['ec']) && !$data['ec']) {
                     $response = $vast->makeEmptyVast();
                 } else {
                     $this->data['listAlternateAd'] = $alternateAds;
                     $this->data['zid'] = $adZone->id;
                     View::addLocation(base_path() . '/frontend/theme/default/views/delivery');
                     $response = Response::view('rotator', $this->data)->header('Content-Type', 'text/javascript; charset=UTF-8');
                 }
             } else {
                 if (isset($data['ec']) && !$data['ec']) {
                     $response = $vast->makeEmptyVast();
                 }
             }
             (new RawTrackingSummary())->addSummaryRequestEmptyAd($adZone->id, $adZone->ad_format_id, $websiteID);
         }
     }
     //ghi log process
     $trackingModel->logAfterProcess($responseType, $expandFields, $logPreProcess);
     //response to client
     $endProcess = microtime(1);
     pr($deliveryStatus);
     pr($responseType, 1);
     return $response;
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:101,代码来源:DeliveryController.php

示例8: app_path

    } else {
        Log::error($exception);
    }
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
View::addLocation(app_path() . '/themes');
View::addLocation(app_path() . '/themes/default');
开发者ID:jeff-silva,项目名称:motor,代码行数:30,代码来源:global.php

示例9: 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

示例10: show_admin_bar

        //kd($module->getpath());
    }
}
//add_filter('theme_root',function($theme_root){
//    return __DIR__;
//});
//add_filter('theme_root_uri',function($theme_root_uri = '', $siteurl = '', $stylesheet_or_template = ''){
//    kd($theme_root_uri, $siteurl, $stylesheet_or_template);
//    return content_url();
//});
show_admin_bar(false);
// 上传图片时把绝对地址修改成相对地址(禁用,导致上传文件http错误)
//add_filter('wp_handle_upload', function ($fileInfos){
//    global $blog_id;
//    $path = get_blog_option($blog_id, 'siteurl');
//
//    $fileInfos['url'] = str_replace($path, '', $fileInfos['url']);
//
//    return $fileInfos;
//});
add_action("user_register", function ($user_id) {
    update_user_meta($user_id, 'show_admin_bar_front', false);
    //update_user_meta( $user_id, 'show_admin_bar_admin', 'false' );
}, 10, 1);
if (is_dir(get_template_directory() . '/Resources/views')) {
    View::addLocation(get_template_directory() . '/Resources/views');
    View::addNamespace('tpl', get_template_directory() . '/Resources/views');
}
View::addLocation(get_template_directory());
View::addNamespace('default', get_template_directory());
//kd(get_template_directory());
开发者ID:ycms,项目名称:framework,代码行数:31,代码来源:init.php

示例11: __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

示例12: array

<?php

/**
 * Cutlass includes
 *
 * The $cutlass_includes array determines the code library included in your theme.
 * Add or remove files to the array as needed. Supports child theme overrides.
 *
 * Please note that missing files will produce a fatal error.
 */
$cutlass_includes = array('utils.php', 'init.php', 'config.php', 'activation.php', 'titles.php', 'wp_bootstrap_navwalker.php', 'gallery.php', 'comments.php', 'scripts.php', 'extras.php');
///if (defined('TEMPLATEPATH')) {
View::addLocation(__DIR__ . '/Resources/views');
View::addNamespace('tpl', __DIR__ . '/Resources/views');
//}
foreach ($cutlass_includes as $file) {
    if (!($filepath = locate_template("Entities/{$file}"))) {
        trigger_error(sprintf(__('Error locating %s for inclusion', 'cutlass'), $file), E_USER_ERROR);
    }
    require_once $filepath;
}
unset($file, $filepath);
开发者ID:ycms,项目名称:theme-base,代码行数:22,代码来源:functions.php

示例13: foreach

<?php

View::share('currentuser', Auth::user());
Asset::push('js', 'application');
Asset::push('css', 'application');
if (Session::has('errors')) {
    foreach (Session::get('errors')->all() as $message) {
        Log::error($message);
    }
}
View::addLocation(app_path() . '/base/views');
开发者ID:k4ml,项目名称:laravel-base,代码行数:11,代码来源:boot.php

示例14: boot

 public function boot()
 {
     \View::addLocation(__DIR__ . '/../Views');
     // Bring in the routes
     require __DIR__ . '/../routes.php';
 }
开发者ID:viirre,项目名称:laravel-module-generator,代码行数:6,代码来源:ModuleProvider.php

示例15: app_path

    Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
View::addLocation(DIRNAME(app_path()) . '/src/views');
require app_path() . '/helpers/Validate.php';
require app_path() . '/helpers/General.php';
// require app_path() . '/helpers/Images.php';
// require app_path() . '/helpers/scss.inc.php';
开发者ID:jacobross85,项目名称:community,代码行数:31,代码来源:global.php


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