robclancy / presenter

Decorate your objects using presenters. Primarily to keep presentation logic out of your models.
MIT License
345 stars 38 forks source link

Support for arrays in View:with() #14

Closed skovachev closed 11 years ago

skovachev commented 11 years ago

Added support for arrays in the Robbo\Presenter\View\View's with() method

robclancy commented 11 years ago

Can you show me what kind of code this makes work?

skovachev commented 11 years ago

In Laravel you can use the View::with method in two ways:

1) By passing a key and a value like so:

View::make('profile')->with('user', new User);

2) By passing an array of data:

View::make('profile')->with(array(
    'user' => new User
));

Your package supported only 1) and I needed 2). Both versions are supported by the default Laravel View class.

robclancy commented 11 years ago

This has been merged into the develop branch.