Closed seblavoie closed 11 years ago
I tried installing it in a L4 app with resourceful controllers and followed documentation's steps.
app/presenters
Created app/presenters/ProjectPresenters.php containing this code:
app/presenters/ProjectPresenters.php
<?php use Robbo\Presenter\Presenter; class ProjectPresenter extends Presenter { }
Added
class Project extends Eloquent implements PresentableInterface { ... function getPresenter() { return new ProjectPresenter($this); }
to my Project model.
Project
And here's what I have in my controller:
public function index() { return View::make('site/projects/index') ->with('projects', Project::all()); }
But I keep on getting Class 'ProjectPresenter' not found and with this code highlighted:
Class 'ProjectPresenter' not found
public function getPresenter() { return new ProjectPresenter($this); }
The docs seems to contain L3 code but as I understood L4 is supported. Am I missing something?
You need to add the presenters folder to autoloading. Both in composer.json and start/global.php
Oh voilà! Thanks a lot, works like a charm now.
I tried installing it in a L4 app with resourceful controllers and followed documentation's steps.
app/presenters
folder.Created
app/presenters/ProjectPresenters.php
containing this code:Added
to my
Project
model.And here's what I have in my controller:
But I keep on getting
Class 'ProjectPresenter' not found
and with this code highlighted:The docs seems to contain L3 code but as I understood L4 is supported. Am I missing something?