Robbo\Presenter\View\View::with PHP Method

with() public method

Add a piece of data to the view.
public with ( string | array $key, mixed $value = null ) : Illuminate\View\View
$key string | array
$value mixed
return Illuminate\View\View
    public function with($key, $value = null)
    {
        if (is_array($key)) {
            return parent::with($this->factory->decorate($key));
        }
        return parent::with($key, $this->factory->decorate($value));
    }

Usage Example

 public function testWithMakesPresentable()
 {
     $env = new EnvironmentStub(m::mock('Illuminate\\View\\Engines\\EngineResolver'), m::mock('Illuminate\\View\\ViewFinderInterface'), m::mock('Illuminate\\Events\\Dispatcher'));
     $view = new View($env, m::mock('Illuminate\\View\\Engines\\EngineInterface'), 'test', 'test/path');
     $view->with('presenter', new ViewPresentableStub());
     $this->assertTrue($view['presenter'] instanceof Presenter);
 }
All Usage Examples Of Robbo\Presenter\View\View::with
View