-
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
- ComponentPartial
Cms\Classes\ComponentPartial
Source: ~/modules/cms/classes/ComponentPartial.php
Extends:
Implements:
The CMS component partial class. These objects are read-only.
Public properties
public string $fileName
The component partial file name.
public string $mtime
Last modified time.
public string $content
Partial content.
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\ComponentBase $component
A reference to the CMS component containing the object.
protected int $maxNesting
The maximum allowed path nesting level. The default value is 2, meaning that files can only exist in the root directory, or in a subdirectory. Set to null if any level is allowed.
protected array $allowedExtensions
Allowable file extensions.
protected string $defaultExtension
Default file extension.
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\ComponentBase $component)
Creates an instance of the object and associates it with a CMS component.
Parameters
- Cms\Classes\ComponentBase $component - Specifies the component the object belongs to.
public static bool check(Cms\Classes\ComponentBase $component, string $fileName)
Returns true if the specific component contains a matching partial.
Parameters
- Cms\Classes\ComponentBase $component - Specifies a component the file belongs to.
- string $fileName - Specifies the file name to check.
public mixed|static find(string $fileName)
Find a single template by its file name.
Parameters
- string $fileName
public string getBaseFileName()
Returns the file name without the extension.
public string getContent()
Returns the file content.
public string getDefaultExtension()
Returns the default extension used by this template.
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 string getTwigCacheKey()
Returns the key used by the Twig cache.
public string getTwigContent()
Returns the Twig content string.
public static mixed load(Cms\Classes\ComponentBase $component, 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\ComponentBase $component - Specifies the component 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 static mixed loadCached(Cms\Classes\ComponentBase $component, string $fileName)
There is not much point caching a component partial, so this behavior reverts to a regular load call.
Parameters
- Cms\Classes\ComponentBase $component
- string $fileName
public static mixed loadOverrideCached(Cms\Classes\Theme $theme, Cms\Classes\ComponentBase $component, string $fileName)
Checks if a partial override exists in the supplied theme and returns it. Since the beginning of time, October inconsistently checked for overrides using the component alias exactly, resulting in a folder with uppercase characters, subsequently this method checks for both variants.
Parameters
- Cms\Classes\Theme $theme
- Cms\Classes\ComponentBase $component
- string $fileName
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 string validateFileName(string $fileName)
Checks the supplied file name for validity.
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.