File
bundle.php
Package
Default
Class hierarchy
LaravelBundle

Tags

None found

Properties

$bundles

$bundles : array

All of the application's bundles.

Type

array

Tags

None found

$elements

$elements : array

A cache of the parsed bundle elements.

Type

array

Tags

None found

$started

$started : array

All of the bundles that have been started.

Type

array

Tags

None found

$routed

$routed : array

All of the bundles that have their routes files loaded.

Type

array

Tags

None found

Methods

register()

register(string  $bundle, array  $config = array()) : void

Register the bundle for the application.

Parameters

string $bundle
array $config

static

Tags

None found

start()

start(string  $bundle) : void

Load a bundle by running its start-up script.

If the bundle has already been started, no action will be taken.

Parameters

string $bundle

static

Tags

None found

routes()

routes(string  $bundle) : void

Load the "routes" file for a given bundle.

Parameters

string $bundle

static

Tags

None found

disable()

disable(string  $bundle) : void

Disable a bundle for the current request.

Parameters

string $bundle

static

Tags

None found

handles()

handles(string  $uri) : string

Determine which bundle handles the given URI.

The default bundle is returned if no other bundle is assigned.

Parameters

string $uri

Returns

string

static

Tags

None found

exists()

exists(string  $bundle) : boolean

Determine if a bundle exists within the bundles directory.

Parameters

string $bundle

Returns

boolean

static

Tags

None found

started()

started(string  $bundle) : void

Determine if a given bundle has been started for the request.

Parameters

string $bundle

static

Tags

None found

routed()

routed(string  $bundle) : void

Determine if a given bundle has its routes file loaded.

Parameters

string $bundle

static

Tags

None found

prefix()

prefix(string  $bundle) : string

Get the identifier prefix for the bundle.

Parameters

string $bundle

Returns

string

static

Tags

None found

class_prefix()

class_prefix(string  $bundle) : string

Get the class prefix for a given bundle.

Parameters

string $bundle

Returns

string

static

Tags

None found

path()

path(string  $bundle) : string

Return the root bundle path for a given bundle.

// Returns the bundle path for the "admin" bundle $path = Bundle::path('admin');

// Returns the path('app') constant as the default bundle
$path = Bundle::path('application');

Parameters

string $bundle

Returns

string

static

Tags

None found

assets()

assets(string  $bundle) : string

Return the root asset path for the given bundle.

Parameters

string $bundle

Returns

string

static

Tags

None found

name()

name(string  $identifier) : string

Get the bundle name from a given identifier.

// Returns "admin" as the bundle name for the identifier $bundle = Bundle::name('admin::home.index');

Parameters

string $identifier

Returns

string

static

Tags

None found

element()

element(string  $identifier) : string

Get the element name from a given identifier.

// Returns "home.index" as the element name for the identifier $bundle = Bundle::bundle('admin::home.index');

Parameters

string $identifier

Returns

string

static

Tags

None found

identifier()

identifier(string  $bundle, string  $element) : string

Reconstruct an identifier from a given bundle and element.

// Returns "admin::home.index" $identifier = Bundle::identifier('admin', 'home.index');

// Returns "home.index"
$identifier = Bundle::identifier('application', 'home.index');

Parameters

string $bundle
string $element

Returns

string

static

Tags

None found

resolve()

resolve(string  $bundle) : string

Return the bundle name if it exists, else return the default bundle.

Parameters

string $bundle

Returns

string

static

Tags

None found

parse()

parse(string  $identifier) : array

Parse an element identifier and return the bundle name and element.

// Returns array(null, 'admin.user') $element = Bundle::parse('admin.user');

// Parses "admin::user" and returns array('admin', 'user')
$element = Bundle::parse('admin::user');

Parameters

string $identifier

Returns

array

static

Tags

None found

get()

get(string  $bundle) : object

Get the information for a given bundle.

Parameters

string $bundle

Returns

object

static

Tags

None found

option()

option(string  $bundle, string  $option, mixed  $default = null) : mixed

Get an option for a given bundle.

Parameters

string $bundle
string $option
mixed $default

Returns

mixed

static

Tags

None found

all()

all() : array

Get all of the installed bundles for the application.

Returns

array

static

Tags

None found

names()

names() : array

Get all of the installed bundle names.

Returns

array

static

Tags

None found

expand()

expand(string  $path) : string

Expand given bundle path of form "[bundle::]path/.

..".

Parameters

string $path

Returns

string

static

Tags

None found

autoloads()

autoloads(string  $bundle, array  $config) : void

Register the auto-loading configuration for a bundle.

Parameters

string $bundle
array $config

static

Tags

None found