本文整理汇总了PHP中Autoloader::map方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::map方法的具体用法?PHP Autoloader::map怎么用?PHP Autoloader::map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::map方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
Autoloader::map(array('Akismet' => Bundle::path('akismet') . 'Akismet.php'));
示例2:
<?php
Autoloader::map(array('Flyswatter_Base_Controller' => Bundle::path('flyswatter') . 'controllers/base.php'));
Autoloader::namespaces(array('Flyswatter\\Models' => Bundle::path('flyswatter') . 'models'));
示例3:
<?php
/**
* Bootstrapper for creating Twitter Bootstrap markup.
*
* @package Bundles
* @subpackage Twitter
* @author Patrick Talmadge - Follow @patricktalmadge
*
* @see http://twitter.github.com/bootstrap/
*/
Autoloader::map(array('Bootstrapper\\Alert' => __DIR__ . '/alert.php', 'Bootstrapper\\Badges' => __DIR__ . '/badges.php', 'Bootstrapper\\Breadcrumbs' => __DIR__ . '/breadcrumbs.php', 'Bootstrapper\\ButtonGroup' => __DIR__ . '/buttongroup.php', 'Bootstrapper\\Buttons' => __DIR__ . '/buttons.php', 'Bootstrapper\\ButtonToolbar' => __DIR__ . '/buttontoolbar.php', 'Bootstrapper\\Carousel' => __DIR__ . '/carousel.php', 'Bootstrapper\\DropdownButton' => __DIR__ . '/dropdownbutton.php', 'Bootstrapper\\Form' => __DIR__ . '/form.php', 'Bootstrapper\\Helpers' => __DIR__ . '/helpers.php', 'Bootstrapper\\Icons' => __DIR__ . '/icons.php', 'Bootstrapper\\Labels' => __DIR__ . '/labels.php', 'Bootstrapper\\Navbar' => __DIR__ . '/navbar.php', 'Bootstrapper\\Navigation' => __DIR__ . '/navigation.php', 'Bootstrapper\\Paginator' => __DIR__ . '/paginator.php', 'Bootstrapper\\Progress' => __DIR__ . '/progress.php', 'Bootstrapper\\SplitDropdownButton' => __DIR__ . '/splitdropdownbutton.php', 'Bootstrapper\\Tabbable' => __DIR__ . '/tabbable.php', 'Bootstrapper\\Tables' => __DIR__ . '/tables.php', 'Bootstrapper\\Typeahead' => __DIR__ . '/typeahead.php'));
Asset::container('bootstrapper')->bundle('bootstrapper');
//Asset::container('bootstrapper')->add('jquery', 'js/jquery-1.8.1.js');
Asset::container('bootstrapper')->add('jquery', 'js/jquery-1.8.1.min.js');
//Asset::container('bootstrapper')->add('bootstrap', 'css/bootstrap.css');
Asset::container('bootstrapper')->add('bootstrap', 'css/bootstrap.min.css');
//Not Needed if you don't have the top nav bar
Asset::container('bootstrapper')->add('nav-fix', 'css/nav-fix.css');
//Asset::container('bootstrapper')->add('bootstrap-responsive', 'css/bootstrap-responsive.css');
Asset::container('bootstrapper')->add('bootstrap-responsive', 'css/bootstrap-responsive.min.css');
//Asset::container('bootstrapper')->add('bootstrap-js', 'js/bootstrap.js');
Asset::container('bootstrapper')->add('bootstrap-js', 'js/bootstrap.min.js');
示例4:
<?php
Autoloader::namespaces(array('Multup' => Bundle::path('multup') . 'libraries'));
Autoloader::map(array('Multup' => __DIR__ . DS . 'multup.php'));
示例5:
<?php
Autoloader::map(array('SFTP' => __DIR__ . DS . 'classes/SFTP.php'));
示例6: define
<?php
// --------------------------------------------------------------
// Set constants
// --------------------------------------------------------------
define('MUSTACHE_EXT', '.mustache');
// --------------------------------------------------------------
// Register classes
// --------------------------------------------------------------
Autoloader::map(array('Mustache' => __DIR__ . DS . 'mustache' . EXT, 'LaylaMustache' => __DIR__ . DS . 'laylamustache' . EXT));
// --------------------------------------------------------------
// Add event listeners
// --------------------------------------------------------------
Event::listen(View::loader, function ($bundle, $view) {
return LaylaMustache::file($bundle, $view, Bundle::path($bundle) . 'views');
});
Event::listen(View::engine, function ($view) {
// The Blade view engine should only handle the rendering of views which
// end with the Blade extension. If the given view does not, we will
// return false so the View can be rendered as normal.
if (!str_contains($view->path, MUSTACHE_EXT)) {
return;
}
if (count($view->data) > 1) {
$mustache = new LaylaMustache();
return $mustache->render(File::get($view->path), $view->data());
}
return File::get($view->path);
});
示例7: path
| simply register the configured class aliases.
|
*/
$aliases = Laravel\Config::get('application.aliases');
Laravel\Autoloader::$aliases = $aliases;
/*
|--------------------------------------------------------------------------
| Auto-Loader Mappings
|--------------------------------------------------------------------------
|
| Registering a mapping couldn't be easier. Just pass an array of class
| to path maps into the "map" function of Autoloader. Then, when you
| want to use that class, just use it. It's simple!
|
*/
Autoloader::map(array('Base_Controller' => path('app') . 'controllers/base.php', 'Referral' => path('app') . 'models/referrals.php', 'Revenue' => path('app') . 'models/revenues.php', 'User' => path('app') . 'models/users.php', 'Option' => path('app') . 'models/options.php', 'RawNotification' => path('app') . 'models/raw_notifications.php', 'SubscriptionHistory' => path('app') . 'models/subscription_history.php', 'Notification' => path('app') . 'models/notifications.php'));
/*
|--------------------------------------------------------------------------
| Auto-Loader Directories
|--------------------------------------------------------------------------
|
| The Laravel auto-loader can search directories for files using the PSR-0
| naming convention. This convention basically organizes classes by using
| the class namespace to indicate the directory structure.
|
*/
Autoloader::directories(array(path('app') . 'models', path('app') . 'libraries'));
/*
|--------------------------------------------------------------------------
| Laravel View Loader
|--------------------------------------------------------------------------
示例8:
<?php
Autoloader::namespaces(array('extjs' => Bundle::path('extjs') . 'models'));
Autoloader::map(array('lext' => Bundle::path('extjs') . 'libraries/lext.php'));
示例9: path
| conventions throughout the "laravel" directory since all core classes
| are namespaced into the "Laravel" namespace.
|
*/
Autoloader::namespaces(array('Laravel' => path('sys')));
/*
|--------------------------------------------------------------------------
| Register Eloquent Mappings
|--------------------------------------------------------------------------
|
| A few of the Eloquent ORM classes use a non PSR-0 naming standard so
| we will just map them with hard-coded paths here since PSR-0 uses
| underscores as directory hierarchy indicators.
|
*/
Autoloader::map(array('Laravel\\Database\\Eloquent\\Relationships\\Belongs_To' => path('sys') . 'database/eloquent/relationships/belongs_to' . EXT, 'Laravel\\Database\\Eloquent\\Relationships\\Has_Many' => path('sys') . 'database/eloquent/relationships/has_many' . EXT, 'Laravel\\Database\\Eloquent\\Relationships\\Has_Many_And_Belongs_To' => path('sys') . 'database/eloquent/relationships/has_many_and_belongs_to' . EXT, 'Laravel\\Database\\Eloquent\\Relationships\\Has_One' => path('sys') . 'database/eloquent/relationships/has_one' . EXT, 'Laravel\\Database\\Eloquent\\Relationships\\Has_One_Or_Many' => path('sys') . 'database/eloquent/relationships/has_one_or_many' . EXT));
/*
|--------------------------------------------------------------------------
| Register The Symfony Components
|--------------------------------------------------------------------------
|
| Laravel makes use of the Symfony components where the situation is
| applicable and it is possible to do so. This allows us to focus
| on the parts of the framework that are unique and not re-do
| plumbing code that others have written.
|
*/
Autoloader::namespaces(array('Symfony\\Component\\Console' => path('sys') . 'vendor/Symfony/Component/Console', 'Symfony\\Component\\HttpFoundation' => path('sys') . 'vendor/Symfony/Component/HttpFoundation'));
/*
|--------------------------------------------------------------------------
| Magic Quotes Strip Slashes
示例10: array
<?php
/**
* Easily slugify all your Eloquent models
*
* @package Sluggable
* @version 1.0
* @author Colin Viebrock <colin@viebrock.ca>
* @author Bryan te Beek <bryantebeek@gmail.com>
* @link http://github.com/bryantebeek/laravel-bundle-sluggable
*/
Autoloader::map(array('Sluggable' => __DIR__ . DS . 'sluggable.php'));
// Listen to the Eloquent save event so we can sluggify on the fly
Event::listen('eloquent.saving', array('Sluggable', 'make'));
示例11:
<?php
Autoloader::map(array('MenuHTML' => __DIR__ . DS . 'menuhtml' . EXT, 'Menu' => __DIR__ . DS . 'menu' . EXT, 'MenuItems' => __DIR__ . DS . 'menu' . EXT));
示例12:
<?php
use PHPImageWorkshop\ImageWorkshop;
//require_once(__DIR__.DS.'PHPImageWorkshop'.DS.'ImageWorkshop.php');
Autoloader::map(array('PHPImageWorkshop\\ImageWorkshop' => __DIR__ . DS . 'PHPImageWorkshop' . DS . 'ImageWorkshop.php'));
示例13: Exception
<?php
/**
* Authorized for Laravel
*
* @package Bundles
* @subpackage Zend_Acl
* @author Teepluss <teepluss@gmail.com>
*
* @see http://framework.zend.com/manual/1.12/en/zend.acl.html
*/
/**
* Check zend acl component.
*/
if (!class_exists('Zend_Acl')) {
throw new Exception('This bundle required Zend installed.');
}
/**
* Autoload Authorized.
*/
Autoloader::map(array('Authorized' => __DIR__ . DS . 'authorized' . EXT));
/**
* Start using Authorized with authenticated user.
*/
Authorized::initialize(Auth::user());
/**
* Auto route example to url /acl_examples.
*/
Route::any('acl_examples/(:any?)', array('as' => 'acl_examples', 'uses' => 'authorized::examples@(:1)', 'defaults' => 'index'));
示例14: path
| simply register the configured class aliases.
|
*/
$aliases = Laravel\Config::get('application.aliases');
Laravel\Autoloader::$aliases = $aliases;
/*
|--------------------------------------------------------------------------
| Auto-Loader Mappings
|--------------------------------------------------------------------------
|
| Registering a mapping couldn't be easier. Just pass an array of class
| to path maps into the "map" function of Autoloader. Then, when you
| want to use that class, just use it. It's simple!
|
*/
Autoloader::map(array('Admin_Controller' => path('app') . 'controllers/admin.php', 'Base_Controller' => path('app') . 'controllers/base.php', 'WideImage' => path('app') . 'libraries/wideimage/WideImage.php'));
/*
|--------------------------------------------------------------------------
| Auto-Loader Directories
|--------------------------------------------------------------------------
|
| The Laravel auto-loader can search directories for files using the PSR-0
| naming convention. This convention basically organizes classes by using
| the class namespace to indicate the directory structure.
|
*/
Autoloader::directories(array(path('app') . 'models', path('app') . 'libraries'));
/*
|--------------------------------------------------------------------------
| Laravel View Loader
|--------------------------------------------------------------------------
示例15:
<?php
/**
* @author Matthew Muscat < http://www.mamis.com.au/ >
* @copyright 2013 www.mamis.com.au
* @license http://creativecommons.org/licenses/by-sa/3.0/
* @package Facebook (Laravel Bundle)
* @version 1.0 - 2013-02-11
*/
Autoloader::map(array('Facebook' => __DIR__ . '/facebook.php', 'Facebook\\Facebook' => __DIR__ . '/vendor/Facebook.php'));