src/Core/View/AbstractView.php
public function applyData($name, $handler = null)
    {
        if (is_callable($name)) {
            $handler = $name;
            $name    = null;
        }

        $handler($this->getRepository($name), $this->getData());

        return $this;
    }
public function applyData($name, $handler = null)
    {
        if (is_callable($name)) {
            $handler = $name;
            $name    = null;
        }

        $handler($this->getRepository($name), $this->getData());

        return $this;
    }
public function applyData ( $ name , $ handler = null ) { if ( is_callable ( $ name ) ) { $ handler = $ name ; $ name = null ; } $ handler ( $ this -> getRepository ( $ name ) , $ this -> getData ( ) ) ; return $ this ; }
Apply a callback to model and view data.

@param string|callable $name    The name alias of model, keep NULL as default model.
Or just send a callable here as handler.
@param callable        $handler The callback handler.

@return  $this
Apply a callback to model and view data .