-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- System
- Traits
- ViewMaker
System\Traits\ViewMaker
Source: ~/modules/system/traits/ViewMaker.php
View Maker Trait Adds view based methods to a class
Public properties
public array $vars
A list of variables to pass to the page.
public string $layout
Layout to use for the view.
public bool $suppressLayout
Prevents the use of a layout.
Protected properties
protected string|array $viewPath
Specifies a path to the views directory.
protected string $layoutPath
Specifies a path to the layout directory.
Public methods
public void addViewPath(string|array $path)
Prepends a path on the available view path locations.
Parameters
- string|array $path
public string getViewPath(string $fileName, mixed $viewPath=NULL)
Locates a file based on its definition. The file name can be prefixed with a symbol (~|$) to return in context of the application or plugin base path, otherwise it will be returned in context of this object view path.
Parameters
- string $fileName - File to load.
- mixed $viewPath - Explicitly define a view path.
public array getViewPaths()
Returns the active view path locations.
public string guessViewPath(string $suffix='', bool $isPublic=false)
Guess the package path for the called class.
Parameters
- string $suffix - An extra path to attach to the end
- bool $isPublic - Returns public path instead of an absolute one
public string guessViewPathFrom(string $class, string $suffix='', bool $isPublic=false)
Guess the package path from a specified class.
Parameters
- string $class - Class to guess path from.
- string $suffix - An extra path to attach to the end
- bool $isPublic - Returns public path instead of an absolute one
public string makeFileContents(string $filePath, array $extraParams=array())
Includes a file path using output buffering. Ensures that vars are available.
Parameters
- string $filePath - Absolute path to the view file.
- array $extraParams - Parameters that should be available to the view.
public mixed makeLayout(string $name=NULL, array $params=array(), bool $throwException=true)
Render a layout.
Parameters
- string $name - Specifies the layout name. If this parameter is omitted, the $layout property will be used.
- array $params - Parameter variables to pass to the view.
- bool $throwException - Throw an exception if the layout is not found
public string makeLayoutPartial(string $partial, array $params=array())
Renders a layout partial
Parameters
- string $partial - The view to load.
- array $params - Parameter variables to pass to the view.
public mixed makePartial(string $partial, array $params=array(), bool $throwException=true)
Render a partial file contents located in the views folder.
Parameters
- string $partial - The view to load.
- array $params - Parameter variables to pass to the view.
- bool $throwException - Throw an exception if the partial is not found.
public string makeView(string $view)
Loads a view with the name specified. Applies layout if its name is provided by the parent object. The view file must be situated in the views directory, and has the extension "htm".
Parameters
- string $view - Specifies the view name, without extension. Eg: "index".
public string makeViewContent(string $contents, string $layout=NULL)
Renders supplied contents inside a layout.
Parameters
- string $contents - The inner contents as a string.
- string $layout - Specifies the layout name.
Protected methods
protected void handleViewException(Exception $e, int $obLevel)
Handle a view exception.
Parameters
- Exception $e
- int $obLevel