__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.
array
Optional config override
__toString() : string
uses | \Fuel\Core\Theme::render |
---|
string
active(string $theme) : array
Will return the currently active theme. It will throw a \ThemeException if it cannot locate the theme.
string
Theme name to set active
\ThemeException |
---|
array
The theme arrayadd_path(string $path) : void
string
Path to add
add_paths(array $paths) : void
array
Paths to add
all() : array
array
asset_path(string $path) : string
string
Relative path to the asset
\ThemeException |
---|
string
Full 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.
string
Theme name to set active
\ThemeException |
---|
array
The theme arrayfind(string $theme) : string | false
If
found it will return the path, else it will return false
.
string
Theme to find
string
false
Path or false if not foundget_chrome(string $section) : mixed
string
Name of the partial section in the template
\ThemeException |
---|
mixed
get_info(mixed $var, mixed $default, mixed $theme) : mixed
mixed
mixed
mixed
\ThemeException |
---|
mixed
get_partial(string $section, string $view) : \Fuel\Core\View
string
Name of the partial section in the template
string
name of the view
\ThemeException |
---|
has_partials(string $section) : bool
string
Name of the partial section in the template
bool
instance(string $name, array $config) : \Fuel\Core\Theme
Will return the requested instance, or will create a new named one if it does not exist.
string
The instance name
array
load_info(string $theme) : array
string
Name of the theme (null for active)
\ThemeException |
---|
array
Theme info arraypartial_count(string $section) : int
string
Name of the partial section in the template
int
presenter(string $presenter, string $method, bool $auto_filter, string $view) : \Fuel\Core\Presenter
string
Presenter classname without View_ prefix or full classname
string
Method to execute
bool
Auto filter the view data
string
Custom View to associate with this persenter
save_info(string $type) : array
string
Name of the theme (null for active)
\ThemeException |
---|
array
Theme 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,
string
Name of the partial section in the template
string
Name of the variable in the chrome that will output the partial
set_order(string $section, mixed $order)
string
name 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
string
Name of the partial section in the template
bool
If 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
bool
string
enable if true or string, disable if false
view(string $view, array $data, bool $auto_filter) : \Fuel\Core\View
string
View name
array
View data
bool
Auto filter the view data
\ThemeException |
---|
\Fuel\Core\View
New View objectviewmodel(string $view, string $method, bool $auto_filter) : \Fuel\Core\View
deprecated | 1.8 |
---|
string
ViewModel classname without View_ prefix or full classname
string
Method to execute
bool
Auto filter the view data
\Fuel\Core\View
New View objectcreate_theme_array(string $theme) : array
It will throw a \ThemeException if it cannot locate the theme.
string
Theme name to set active
\ThemeException |
---|
array
The 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).
string
name of the view to find
array
optional array of themes to search
\ThemeException |
when not found |
---|
string
absolute path to the viewset_theme(string $theme, string $type) : array
string
Theme name to set active
string
name of the internal theme array to set
\ThemeException |
---|
array
The theme array$active : array
$chrome : array
$config : array
$fallback : array
$instances : array
$order : array
$partials : array
$paths : array