Closed alexwhitman closed 11 years ago
Closed. Spoke about this on IRC.
Hi, could I have details of what was spoken about this on IRC?
Facing the same problem - trying to find the best way to solve it.
Cheers.
I can't remember. Basically you need to decorate it yourself I can't magically tell it to use a presenter instance in that way. When you want the presenter just call ->getPresenter()
yourself or something. Give me a more specific use case and I can tell you how I would do it.
Cool. That's how I was doing it - doesn't look pretty but it works.
Cheers for that!
I'm using Presenter with some Eloquent models which works fine for the 'top-level' model, but relationships aren't converted to a presenter.
For example, if I have classes defined as:
In a controller:
In the view:
prints
test -
because$user->department
isn't an instance ofGenericPresenter
.Now obviously my use case is Eloquent specific, but it would be useful if there was a way of defining relationships/attributes which should also be made presentable if they implement
PresentableInterface
.