-
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
- Cms
- Classes
- Asset
Cms\Classes\Asset
Source: ~/modules/cms/classes/Asset.php
Extends:
The CMS theme asset file class.
Public properties
public string $fileName
Specifies the file name corresponding the CMS object.
public string $mtime
Last modified time.
public string $content
The entire file content.
public bool $exists
Indicates if the model exists.
Show inherited public properties
Inherited public properties
- public array $implement - defined in October\Rain\Extension\Extendable. Extensions implemented by this class.
Protected properties
protected Cms\Classes\Theme $theme
A reference to the CMS theme containing the object.
protected string $dirName
The container name inside the theme.
protected string $originalFileName
Specifies the file name, the CMS object was loaded from.
protected array $fillable
The attributes that are mass assignable.
protected array $allowedExtensions
Allowable file extensions.
Show inherited protected properties
Inherited protected properties
- protected array $extensionData - defined in October\Rain\Extension\Extendable. Class reflection information, including behaviors.
- protected static array $extendableCallbacks - defined in October\Rain\Extension\Extendable. Used to extend the constructor of an extendable class.
- protected static array $extendableStaticMethods - defined in October\Rain\Extension\Extendable. Collection of static methods used by behaviors.
- protected static bool $extendableGuardProperties - defined in October\Rain\Extension\Extendable. Indicates if dynamic properties can be created.
Public methods
public void __construct(Cms\Classes\Theme $theme)
Creates an instance of the object and associates it with a CMS theme.
Parameters
- Cms\Classes\Theme $theme - Specifies the theme the object belongs to.
public void delete()
public void fill(array $attributes)
Sets the object attributes.
Parameters
- array $attributes - A list of attributes to set.
public mixed|static find(string $fileName)
Find a single template by its file name.
Parameters
- string $fileName
public static array getEditableExtensions()
Returns a list of editable asset extensions. The list can be overridden with the cms.editableAssetTypes configuration option.
public string getFileName()
Returns the file name.
public string getFilePath(string $fileName=NULL)
Returns the absolute file path.
Parameters
- string $fileName - Specifies the file name to return the path to.
public static $this inTheme(Cms\Classes\Theme|string $theme)
Prepares the theme datasource for the model.
Parameters
- Cms\Classes\Theme|string $theme - Specifies a parent theme.
public static mixed load(Cms\Classes\Theme $theme, string $fileName)
Loads the object from a file. This method is used in the CMS back-end. It doesn't use any caching.
Parameters
- Cms\Classes\Theme $theme - Specifies the theme the object belongs to.
- string $fileName - Specifies the file name, with the extension. The file name can contain only alphanumeric symbols, dashes and dots.
public void save()
Saves the object to the disk.
Inherited public methods
- public void __call($name, $params) - defined in October\Rain\Extension\Extendable.
- public static void __callStatic($name, $params) - defined in October\Rain\Extension\Extendable.
- public void __get($name) - defined in October\Rain\Extension\Extendable.
- public void __set($name, $value) - defined in October\Rain\Extension\Extendable.
- public void addDynamicMethod(string $dynamicName, callable $method, string $extension=NULL) - defined in October\Rain\Extension\Extendable. Programmatically adds a method to the extendable class.
- public void addDynamicProperty(string $dynamicName, string $value=NULL) - defined in October\Rain\Extension\Extendable. Programmatically adds a property to the extendable class.
- public mixed asExtension(string $shortName) - defined in October\Rain\Extension\Extendable. Short hand for
getClassExtension()
method, except takes the short. - public static void clearExtendedClasses() - defined in October\Rain\Extension\Extendable. Clear the list of extended classes so they will be re-extended.
- public static void extend($callback) - defined in October\Rain\Extension\Extendable.
- public void extendClassWith(string $extensionName) - defined in October\Rain\Extension\Extendable. Dynamically extend a class with a specified behavior.
- public mixed extendableCall(string $name, array $params=NULL) - defined in October\Rain\Extension\Extendable. Magic method for
__call()
. - public static mixed extendableCallStatic(string $name, array $params=NULL) - defined in October\Rain\Extension\Extendable. Magic method for
__callStatic()
. - public void extendableConstruct() - defined in October\Rain\Extension\Extendable. This method should be called as part of the constructor.
- public static void extendableExtendCallback(callable $callback) - defined in October\Rain\Extension\Extendable. Helper method for
::extend()
static method. - public string extendableGet(string $name) - defined in October\Rain\Extension\Extendable. Magic method for
__get()
. - public string extendableSet(string $name, string $value) - defined in October\Rain\Extension\Extendable. Magic method for
__set()
. - public mixed getClassExtension(string $name) - defined in October\Rain\Extension\Extendable. Returns a behavior object from an extendable class, example:.
- public array getClassMethods() - defined in October\Rain\Extension\Extendable. Get a list of class methods, extension equivalent of get_class_methods().
- public array getDynamicProperties() - defined in October\Rain\Extension\Extendable. Returns all dynamic properties and their values.
- public boolean isClassExtendedWith(string $name) - defined in October\Rain\Extension\Extendable. Check if extendable class is extended with a behavior object.
- public boolean methodExists(string $name) - defined in October\Rain\Extension\Extendable. Checks if a method exists, extension equivalent of method_exists().
- public boolean propertyExists(string $name) - defined in October\Rain\Extension\Extendable. Checks if a property exists, extension equivalent of
property_exists()
.
Protected methods
protected void validateFileName(string $fileName=NULL)
Validate the supplied filename, extension and path.
Parameters
- string $fileName
Show inherited protected methods
Inherited protected methods
- protected boolean extendableIsAccessible(mixed $class, string $propertyName) - defined in October\Rain\Extension\Extendable. Checks if a property is accessible, property equivalent of
is_callable()
. - protected void extensionExtractMethods(string $extensionName, object $extensionObject) - defined in October\Rain\Extension\Extendable. Extracts the available methods from a behavior and adds it to the.