__construct()
__toString()
active()
add_path()
add_paths()
all()
asset_path()
fallback()
find()
forge()
get_chrome()
get_info()
get_partial()
get_template()
has_partials()
instance()
load_info()
partial_count()
presenter()
render()
save_info()
set_chrome()
set_info()
set_order()
set_partial()
set_template()
use_modules()
view()
viewmodel()
create_theme_array()
find_file()
set_theme()
$asset
$template
$active
$chrome
$config
$fallback
$instances
$order
$partials
$paths
Handles loading theme views and assets.
__construct(array $config)
If a config is given, it will not use the config file.
arrayOptional config override
__toString() : string
| uses | \Fuel\Core\Theme::render |
|---|
stringactive(string $theme) : array
Will return the currently active theme. It will throw a \ThemeException if it cannot locate the theme.
stringTheme name to set active
\ThemeException |
|---|
arrayThe theme arrayadd_path(string $path) : void
stringPath to add
add_paths(array $paths) : void
arrayPaths to add
all() : array
arrayasset_path(string $path) : string
stringRelative path to the asset
\ThemeException |
|---|
stringFull asset URL or path if outside docrootfallback(string $theme) : array
This theme will be used if a view or asset cannot be found in the active theme. Will return the fallback theme. It will throw a \ThemeException if it cannot locate the theme.
stringTheme name to set active
\ThemeException |
|---|
arrayThe theme arrayfind(string $theme) : string | false
If
found it will return the path, else it will return false.
stringTheme to find
stringfalsePath or false if not foundget_chrome(string $section) : mixed
stringName of the partial section in the template
\ThemeException |
|---|
mixedget_info(mixed $var, mixed $default, mixed $theme) : mixed
mixed
mixed
mixed
\ThemeException |
|---|
mixedget_partial(string $section, string $view) : \Fuel\Core\View
stringName of the partial section in the template
stringname of the view
\ThemeException |
|---|
has_partials(string $section) : bool
stringName of the partial section in the template
boolinstance(string $name, array $config) : \Fuel\Core\Theme
Will return the requested instance, or will create a new named one if it does not exist.
stringThe instance name
array
load_info(string $theme) : array
stringName of the theme (null for active)
\ThemeException |
|---|
arrayTheme info arraypartial_count(string $section) : int
stringName of the partial section in the template
intpresenter(string $presenter, string $method, bool $auto_filter, string $view) : \Fuel\Core\Presenter
stringPresenter classname without View_ prefix or full classname
stringMethod to execute
boolAuto filter the view data
stringCustom View to associate with this persenter
save_info(string $type) : array
stringName of the theme (null for active)
\ThemeException |
|---|
arrayTheme info arrayset_chrome(string $section, string | \Fuel\Core\View | \Fuel\Core\ViewModel | \Fuel\Core\Presenter $view, string $var) : \Fuel\Core\View | \Fuel\Core\ViewModel | \Fuel\Core\Presenter,
stringName of the partial section in the template
stringName of the variable in the chrome that will output the partial
set_order(string $section, mixed $order)
stringname of the partial section
mixed
\ThemeException |
|---|
set_partial(string $section, string | \Fuel\Core\View | \Fuel\Core\ViewModel | \Fuel\Core\Presenter $view, bool $overwrite) : \Fuel\Core\View
stringName of the partial section in the template
boolIf true overwrite any already defined partials for this section
use_modules(bool | string $enable) : \Fuel\Core\Theme
If enabled, every theme view loaded will be prefixed with the module name, so you don't have to hardcode the module name as a view file prefix
boolstringenable if true or string, disable if false
view(string $view, array $data, bool $auto_filter) : \Fuel\Core\View
stringView name
arrayView data
boolAuto filter the view data
\ThemeException |
|---|
\Fuel\Core\ViewNew View objectviewmodel(string $view, string $method, bool $auto_filter) : \Fuel\Core\View
| deprecated | 1.8 |
|---|
stringViewModel classname without View_ prefix or full classname
stringMethod to execute
boolAuto filter the view data
\Fuel\Core\ViewNew View objectcreate_theme_array(string $theme) : array
It will throw a \ThemeException if it cannot locate the theme.
stringTheme name to set active
\ThemeException |
|---|
arrayThe theme arrayfind_file(string $view, array $themes) : string
You can optionally send an array of themes to search. If you do not, it will search active then fallback (in that order).
stringname of the view to find
arrayoptional array of themes to search
\ThemeException |
when not found |
|---|
stringabsolute path to the viewset_theme(string $theme, string $type) : array
stringTheme name to set active
stringname of the internal theme array to set
\ThemeException |
|---|
arrayThe theme array$active : array
$chrome : array
$config : array
$fallback : array
$instances : array
$order : array
$partials : array
$paths : array