Cms\Classes\CmsController

Overview

CmsController is the master controller for all front-end pages. All requests that have not been picked up already by the router will end up here, then the URL is passed to the front-end controller for processing.

Extends
  • Illuminate\Routing\Controller
See Also

Public Properties

public array $implement

implement behaviors in this controller.

Protected Properties

protected array $extensionData

extensionData contains class reflection information, including behaviors

protected static array $extendableStaticMethods

extendableStaticMethods is a collection of static methods used by behaviors

protected static bool $extendableGuardProperties

extendableGuardProperties indicates if dynamic properties can be created

Show inherited protected properties

Inherited Protected Properties

  • $middleware - The middleware registered on the controller. (defined in Illuminate\Routing\Controller)

Public Methods

public __construct()

public __construct(): void

__construct a new CmsController instance.

public addDynamicMethod()

public addDynamicMethod(
    string $dynamicName,
    callable $method,
    string $extension = null
): void

addDynamicMethod programmatically adds a method to the extendable class

public addDynamicProperty()

public addDynamicProperty(string $dynamicName, string $value = null): void

addDynamicProperty programmatically adds a property to the extendable class

public asExtension()

public asExtension(string $shortName): mixed 

asExtension is short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

public static clearExtendedClasses()

public static clearExtendedClasses(): void

public static extend()

public static extend(Closure $callback): void

extend this object properties upon construction.

public extendClassWith()

public extendClassWith(string $extensionName): void 

extendClassWith dynamically extends a class with a specified behavior

public extendableCall()

public extendableCall(string $name, array $params = null): mixed 

extendableCall magic method for __call()

public static extendableCallStatic()

public static extendableCallStatic(
    string $name,
    array $params = null
): mixed 

extendableCallStatic magic method for __callStatic()

public extendableConstruct()

public extendableConstruct(): void

extendableConstruct should be called as part of the constructor

public extendableDestruct()

public extendableDestruct(): void

extendableDestruct should be called when serializing the object

public static extendableExtendCallback()

public static extendableExtendCallback(callable $callback): void 

extendableExtendCallback is a helper method for ::extend() static method

public extendableGet()

public extendableGet(string $name): string 

extendableGet magic method for __get()

public extendableSet()

public extendableSet(string $name, string $value): string 

extendableSet magic method for __set()

public getClassExtension()

public getClassExtension(string $name): mixed 

getClassExtension returns a behavior object from an extendable class, example:

$this->getClassExtension('Backend.Behaviors.FormController')

public getClassMethodAsReflector()

public getClassMethodAsReflector($name): ReflectionFunctionAbstract 

public getClassMethods()

public getClassMethods(): array 

getClassMethods gets a list of class methods, extension equivalent of get_class_methods()

public getDynamicProperties()

public getDynamicProperties(): array 

getDynamicProperties returns all dynamic properties and their values

public implementClassWith()

public implementClassWith($extensionName): void

implementClassWith will implement an extension using non-interference and should be used with the static extend() method.

public isClassExtendedWith()

public isClassExtendedWith(string $name): boolean 

isClassExtendedWith checks if extendable class is extended with a behavior object

public isClassInstanceOf()

public isClassInstanceOf($interface): bool 

isClassInstanceOf checks if the class implements the supplied interface methods.

public methodExists()

public methodExists(string $name): boolean 

methodExists checks if a method exists, extension equivalent of method_exists()

public propertyExists()

public propertyExists(string $name): boolean 

propertyExists checks if a property exists, extension equivalent of property_exists()

public run()

public run(string $url = '/'): string 

run finds and serves the request using the primary controller.

Show inherited public methods

Inherited Public Methods

  • __call() - Handle calls to missing methods on the controller. (defined in Illuminate\Routing\Controller)
  • callAction() - Execute an action on the controller. (defined in Illuminate\Routing\Controller)
  • getMiddleware() - Get the middleware assigned to the controller. (defined in Illuminate\Routing\Controller)
  • middleware() - Register middleware on the controller. (defined in Illuminate\Routing\Controller)

Protected Methods

protected determineSiteFromPolicy()

protected determineSiteFromPolicy($primary): void

determineSiteFromPolicy returns a site based on the configuration

protected extendableIsAccessible()

protected extendableIsAccessible(
    mixed $class,
    string $propertyName
): boolean 

extendableIsAccessible checks if a property is accessible, property equivalent of is_callable()

protected extendableIsSettingDynamicProperty()

protected extendableIsSettingDynamicProperty(): bool 

extendableIsSettingDynamicProperty returns true if a dynamic property action is taking place

protected extensionExtractImplements()

protected extensionExtractImplements(): array 

extensionExtractImplements will return classes to implement.

protected extensionExtractMethods()

protected extensionExtractMethods(
    string $extensionName,
    object $extensionObject
): void 

extensionExtractMethods extracts the available methods from a behavior and adds it to the list of callable methods

protected findSite()

protected findSite($host, $url): void

findSite locates the site based on the current URL

protected getExtendableMethodFromDynamicMethods()

protected getExtendableMethodFromDynamicMethods($name): callable|null 

protected getExtendableMethodFromExtensions()

protected getExtendableMethodFromExtensions($name): array|null 

protected parseUri()

protected parseUri($site, $url): string 

parseUri removes the prefix from a URL

protected redirectWithoutPrefix()

protected redirectWithoutPrefix($site, $originalUrl, $proposedUrl): void

redirectWithoutPrefix redirects if a prefix is enforced