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


PHP Bundle::option方法代码示例

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


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

示例1: aliasIn

function aliasIn($ns)
{
    $overridenPlarx = \Bundle::option('vane', 'ignorePlarx');
    $ns = trim($ns, '\\');
    foreach ($overridenPlarx as $class) {
        \Autoloader::alias("Vane\\{$class}", "{$ns}\\{$class}");
    }
    Plarx::supersede($ns, $overridenPlarx);
}
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:9,代码来源:core.php

示例2: array

<?php

namespace Vane;

\Bundle::$bundles['vane']['ignorePlarx'] = array('Str', 'HLEx', 'Log', 'Event', 'Validator');
if (!\Bundle::exists('plarx')) {
    throw new Error('Vane requires Plarx bundle installed.');
} else {
    \Bundle::start('plarx');
    \Px\Plarx::supersede(__NAMESPACE__, \Bundle::option('vane', 'ignorePlarx'));
}
if (!\Bundle::exists('squall')) {
    throw new Error('Vane requires Squall bundle installed.');
} else {
    \Bundle::start('squall');
    \Squall\initEx(__NAMESPACE__);
}
\Autoloader::namespaces(array(__NAMESPACE__ => __DIR__ . DS . 'classes'));
require_once __DIR__ . DS . 'core.php';
overrideHTMLki('vane::', __NAMESPACE__);
// vane::auth[:[!]perm[:[!]perm.2[...]]] [|filter:2 [|...]]
//
// This filter will always deny access for non-authorized users even if guest
// permissions allow for given features - this is so because protected controllers
// rely on current user being logged in.
\Route::filter('vane::auth', function ($feature_1 = null) {
    $features = is_array($feature_1) ? $feature_1 : func_get_args();
    $block = is_object(end($features)) ? array_pop($features) : null;
    $user = \Auth::user();
    if ($user and !$user instanceof UserInterface) {
        $msg = "When using vane::auth filter object returned by Auth::user()" . " (" . get_class($user) . " here) must implement Vane\\UserInterface." . " This is not so - returned 403 for user {$user->id}.";
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:31,代码来源:start.php

示例3: show

 /**
  * Return the URL to the asset route container.
  * 
  * @param  string  $route
  * @return string
  */
 public static function show($route)
 {
     $methods = array('css' => 'style', 'js' => 'script');
     // If the container is set to development mode then Basset will show all the assets that have been added
     // up until now. This may be a problem if assets are added after the template view is rendered, however
     // this is acceptable. Assets should be added as early as possible during the application logic.
     $container = static::$routes[Bundle::option('basset', 'handles') . '/' . $route];
     if ($container->config->get('development')) {
         $response = '<!-- BASSET NOTICE: Some assets may not be displayed depending on where they were set during the application flow. -->';
         return $response . PHP_EOL . $container->compile();
     }
     return HTML::$methods[File::extension($route)](URL::to_asset(Bundle::option('basset', 'handles') . '/' . $route));
 }
开发者ID:nenoraith,项目名称:sowcomposer,代码行数:19,代码来源:basset.php

示例4: function

     * This is what makes it possible for Basset routes to be adjusted prior to them being displayed.
     */
    $handler = Bundle::handles(URI::current());
    Route::filter("{$handler}::before", function () {
        Config::set('session.driver', '');
        return Basset::compiled();
    });
    /**
     * After the Basset route is run we'll adjust the response object setting the appropriate content
     * type for the assets.
     */
    Route::filter("{$handler}::after", function ($response) {
        $types = array('less' => 'text/css', 'sass' => 'text/css', 'scss' => 'text/css', 'css' => 'text/css', 'js' => 'text/javascript');
        $extension = File::extension(Request::uri());
        if (array_key_exists($extension, $types)) {
            $response->header('Content-Type', $types[$extension]);
        }
        // To prevent any further output being added to any Basset routes we'll clear any events listening
        // for the laravel.done event.
        Event::clear('laravel.done');
    });
}
/**
 * If the current URI is not being handled by Basset then all registered Basset routes will be
 * compiled once Laravel has finished doing its thing.
 */
if (!starts_with(URI::current(), Bundle::option('basset', 'handles'))) {
    Event::listen('laravel.done', function () {
        Basset::compile();
    });
}
开发者ID:nenoraith,项目名称:sowcomposer,代码行数:31,代码来源:start.php

示例5: Exception

<?php

if (Bundle::option('textpub', 'auto')) {
    $paths = TextPub::option('paths') ?: Bundle::option('textpub', 'handles');
    if (!$paths) {
        throw new Exception("Text Publisher (textpub) requires 'paths' or/and" . " 'handles' options but none are set.");
    }
    TextPub::register('' . Router::$bundle, $paths);
}
开发者ID:SerdarSanri,项目名称:TextPub,代码行数:9,代码来源:routes.php

示例6: bundleURL

 static function bundleURL()
 {
     $handles = \Bundle::option(Request::$route->bundle, 'handles');
     $handles = trim($handles, '/');
     return $handles === '' ? '/' : "/{$handles}/";
 }
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:6,代码来源:Current.php

示例7: testOptionMethodReturnsBundleOption

 /**
  * Test the Bundle::get method.
  *
  * @group laravel
  */
 public function testOptionMethodReturnsBundleOption()
 {
     $this->assertFalse(Bundle::option('dashboard', 'auto'));
     $this->assertEquals('dashboard', Bundle::option('dashboard', 'location'));
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:10,代码来源:bundle.test.php


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