PHP Class Caffeinated\Themes\Themes

Datei anzeigen Open project: caffeinated/themes

Protected Properties

Property Type Description
$active string
$config Illuminate\Config\Repository
$files Illuminate\Filesystem\Filesystem
$layout string
$path string
$viewFactory View

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\Config\Repository $config, Illuminate\View\Factory $viewFactory ) Constructor method.
all ( ) : Illuminate\Database\Eloquent\Collection Get all themes.
asset ( $asset ) : string Generate a HTML link to the given asset using HTTP for the currently active theme.
exists ( string $theme ) : boolean Check if given theme exists.
getActive ( ) : string Gets active theme.
getJsonContents ( string $theme ) : array | mixed Get theme JSON content as an array.
getJsonPath ( string $theme ) : string Get path of theme JSON file.
getLayout ( ) : string Get theme layout.
getPath ( ) : string Gets themes path.
getProperty ( string $property, null | string $default = null ) : mixed Get a theme manifest property value.
getThemePath ( string $theme ) : string Gets the specified themes path.
getView ( string $view ) : string | null Gets the given view file.
register ( ) : null Register custom namespaces for all themes.
registerNamespace ( string $theme ) : null Register custom namespaces for specified theme.
response ( string $view, array $data = [], integer $status = 200, array $headers = [] ) : Response Return a new theme view response from the application.
secureAsset ( $asset ) : string Generate a HTML link to the given asset using HTTPS for the currently active theme.
setActive ( $theme ) : Themes Sets active theme.
setJsonContents ( string $theme, array $content ) : integer Set theme manifest JSON content property value.
setLayout ( $layout ) : Themes Sets theme layout.
setPath ( string $path ) : self Sets themes path.
setProperty ( string $property, mixed $value ) : boolean Set a theme manifest property value.
view ( string $view, array $data = [] ) : View Render theme view file.
viewExists ( string $view ) : boolean Checks if the given view file exists (anywhere).

Protected Methods

Method Description
getModuleView ( string $view ) : null | string Get module view file.
getThemeNamespace ( string $key, $theme = null ) : string Get the specified themes View namespace.

Method Details

__construct() public method

Constructor method.
public __construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\Config\Repository $config, Illuminate\View\Factory $viewFactory )
$files Illuminate\Filesystem\Filesystem
$config Illuminate\Config\Repository
$viewFactory Illuminate\View\Factory

all() public method

Get all themes.
public all ( ) : Illuminate\Database\Eloquent\Collection
return Illuminate\Database\Eloquent\Collection

asset() public method

Generate a HTML link to the given asset using HTTP for the currently active theme.
public asset ( $asset ) : string
return string

exists() public method

Check if given theme exists.
public exists ( string $theme ) : boolean
$theme string
return boolean

getActive() public method

Gets active theme.
public getActive ( ) : string
return string

getJsonContents() public method

Get theme JSON content as an array.
public getJsonContents ( string $theme ) : array | mixed
$theme string
return array | mixed

getJsonPath() public method

Get path of theme JSON file.
public getJsonPath ( string $theme ) : string
$theme string
return string

getLayout() public method

Get theme layout.
public getLayout ( ) : string
return string

getModuleView() protected method

Get module view file.
protected getModuleView ( string $view ) : null | string
$view string
return null | string

getPath() public method

Gets themes path.
public getPath ( ) : string
return string

getProperty() public method

Get a theme manifest property value.
public getProperty ( string $property, null | string $default = null ) : mixed
$property string
$default null | string
return mixed

getThemeNamespace() protected method

Get the specified themes View namespace.
protected getThemeNamespace ( string $key, $theme = null ) : string
$key string
return string

getThemePath() public method

Gets the specified themes path.
public getThemePath ( string $theme ) : string
$theme string
return string

getView() public method

Gets the given view file.
public getView ( string $view ) : string | null
$view string
return string | null

register() public method

Register custom namespaces for all themes.
public register ( ) : null
return null

registerNamespace() public method

Register custom namespaces for specified theme.
public registerNamespace ( string $theme ) : null
$theme string
return null

response() public method

Return a new theme view response from the application.
public response ( string $view, array $data = [], integer $status = 200, array $headers = [] ) : Response
$view string
$data array
$status integer
$headers array
return Symfony\Component\HttpFoundation\Response

secureAsset() public method

Generate a HTML link to the given asset using HTTPS for the currently active theme.
public secureAsset ( $asset ) : string
return string

setActive() public method

Sets active theme.
public setActive ( $theme ) : Themes
return Themes

setJsonContents() public method

Set theme manifest JSON content property value.
public setJsonContents ( string $theme, array $content ) : integer
$theme string
$content array
return integer

setLayout() public method

Sets theme layout.
public setLayout ( $layout ) : Themes
return Themes

setPath() public method

Sets themes path.
public setPath ( string $path ) : self
$path string
return self

setProperty() public method

Set a theme manifest property value.
public setProperty ( string $property, mixed $value ) : boolean
$property string
$value mixed
return boolean

view() public method

Render theme view file.
public view ( string $view, array $data = [] ) : View
$view string
$data array
return View

viewExists() public method

Checks if the given view file exists (anywhere).
public viewExists ( string $view ) : boolean
$view string
return boolean

Property Details

$active protected_oe property

protected string $active
return string

$config protected_oe property

protected Repository,Illuminate\Config $config
return Illuminate\Config\Repository

$files protected_oe property

protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$layout protected_oe property

protected string $layout
return string

$path protected_oe property

protected string $path
return string

$viewFactory protected_oe property

protected View $viewFactory
return View