src/Theme.php
public function bind($variable, $callback = null)
    {
        $name = 'bind.'.$variable;

        // If callback pass, so put in a queue.
        if (! empty($callback)) {
            // Preparing callback in to queues.
            $this->events->listen($name, function() use ($callback, $variable) {
                return ($callback instanceof Closure) ? $callback() : $callback;
            });
        }

        // Passing variable to closure.
        $_events   =& $this->events;
        $_bindings =& $this->bindings;

        // Buffer processes to save request.
        return array_get($this->bindings, $name, function() use (&$_events, &$_bindings, $name) {
            $response = current($_events->fire($name));
            array_set($_bindings, $name, $response);
            return $response;
        });
    }
public function bind($variable, $callback = null)
    {
        $name = 'bind.'.$variable;

        // If callback pass, so put in a queue.
        if (! empty($callback)) {
            // Preparing callback in to queues.
            $this->events->listen($name, function() use ($callback, $variable) {
                return ($callback instanceof Closure) ? $callback() : $callback;
            });
        }

        // Passing variable to closure.
        $_events   =& $this->events;
        $_bindings =& $this->bindings;

        // Buffer processes to save request.
        return array_get($this->bindings, $name, function() use (&$_events, &$_bindings, $name) {
            $response = current($_events->fire($name));
            array_set($_bindings, $name, $response);
            return $response;
        });
    }
public function bind ( $ variable , $ callback = null ) { $ name = 'bind.' . $ variable ; // If callback pass, so put in a queue. if ( ! empty ( $ callback ) ) { // Preparing callback in to queues. $ this -> events -> listen ( $ name , function ( ) use ( $ callback , $ variable ) { return ( $ callback instanceof Closure ) ? $ callback ( ) : $ callback ; } ) ; } // Passing variable to closure. $ _events = & $ this -> events ; $ _bindings = & $ this -> bindings ; // Buffer processes to save request. return array_get ( $ this -> bindings , $ name , function ( ) use ( & $ _events , & $ _bindings , $ name ) { $ response = current ( $ _events -> fire ( $ name ) ) ; array_set ( $ _bindings , $ name , $ response ) ; return $ response ; } ) ; }
Binding data to view.

@param  string $variable
@param  mixed  $callback
@return mixed
Binding data to view .