Cell
    
            
            in package
            
        
    
    
    
Class Cell
A simple class that can call any other class that can be loaded, and echo out it's result. Intended for displaying small blocks of content within views that can be managed by other libraries and not require they are loaded within controller.
Used with the helper function, it's use will look like:
    viewCell('\Some\Class::method', 'limit=5 sort=asc', 60, 'cache-name');
Parameters are matched up with the callback method's arguments of the same name:
    class Class {
        function method($limit, $sort)
    }
Alternatively, the params will be passed into the callback method as a simple array if matching params are not found.
    class Class {
        function method(array $params=null)
    }
Tags
Table of Contents
Properties
- $cache : CacheInterface
- Instance of the current Cache Instance
Methods
- __construct() : mixed
- Cell constructor.
- prepareParams() : array<string, string>
- Parses the params attribute. If an array, returns untouched.
- render() : string
- Render a cell, returning its body as a string.
- determineClass() : array<string|int, mixed>
- Given the library string, attempts to determine the class and method to call.
- renderCell() : string
- Renders a cell that extends the BaseCell class.
- renderSimpleClass() : string
- Renders the non-Cell class, passing in the string/array params.
- getMethodParams() : array<string|int, mixed>
- Returns the values from $params that match the parameters for a method, in the order they are defined. This allows them to be passed directly into the method.
Properties
$cache
Instance of the current Cache Instance
        protected
            CacheInterface
    $cache
    
    
    
    
    
    
Methods
__construct()
Cell constructor.
    public
                    __construct(CacheInterface $cache) : mixed
    Parameters
- $cache : CacheInterface
prepareParams()
Parses the params attribute. If an array, returns untouched.
    public
                    prepareParams(array<string, string>|float|string|null $params) : array<string, string>
    If a string, it should be in the format "key1=value key2=value". It will be split and returned as an array.
Parameters
- $params : array<string, string>|float|string|null
Return values
array<string, string>render()
Render a cell, returning its body as a string.
    public
                    render(string $library[, array<string, string>|string|null $params = null ][, int $ttl = 0 ][, string|null $cacheName = null ]) : string
    Parameters
- $library : string
- 
                    Cell class and method name. 
- $params : array<string, string>|string|null = null
- 
                    Parameters to pass to the method. 
- $ttl : int = 0
- 
                    Number of seconds to cache the cell. 
- $cacheName : string|null = null
- 
                    Cache item name. 
Tags
Return values
stringdetermineClass()
Given the library string, attempts to determine the class and method to call.
    protected
                    determineClass(string $library) : array<string|int, mixed>
    Parameters
- $library : string
Return values
array<string|int, mixed>renderCell()
Renders a cell that extends the BaseCell class.
    protected
        final            renderCell(Cell $instance, string $method, array<string|int, mixed> $params) : string
    Parameters
- $instance : Cell
- $method : string
- $params : array<string|int, mixed>
Return values
stringrenderSimpleClass()
Renders the non-Cell class, passing in the string/array params.
    protected
        final            renderSimpleClass(object $instance, string $method, array<string|int, mixed> $params, string $class) : string
    Parameters
- $instance : object
- $method : string
- $params : array<string|int, mixed>
- $class : string
Tags
Return values
stringgetMethodParams()
Returns the values from $params that match the parameters for a method, in the order they are defined. This allows them to be passed directly into the method.
    private
                    getMethodParams(Cell $instance, string $method, array<string|int, mixed> $params) : array<string|int, mixed>
    Parameters
- $instance : Cell
- $method : string
- $params : array<string|int, mixed>