Closed newtonianb closed 11 years ago
Looks good for now. Could you post your UserPresenter?
Yes here it is
<?php
use Robbo\Presenter\Presenter;
class UserPresenter extends \Presenter
{
public $resource_name = 'user';
public function getTest()
{
return 'bla';
}
public function isActivated()
{
if( $this->confirmed )
{
return false;
}
else
{
return true;
}
}
public function currentUser()
{
if( Auth::check() )
{
return Auth::user()->email;
}
else
{
return null;
}
}
public function displayDate()
{
return date('m-d-y', strtotime($this->created_at));
}
/**
* Returns the date of the user creation,
* on a good and more readable format :)
*
* @return string
*/
public function created_at()
{
return 'bla';
// return String::date($this->created_at);
}
/**
* Returns the date of the user last update,
* on a good and more readable format :)
*
* @return string
*/
public function updated_at()
{
return String::date($this->updated_at);
}
}
What if you var_dump your user in your template?
Shouldn't your presenter method be presentTest() to call $user->test (prefixed with "present") (I think this is optional)
If your var_dump results in your user object you maybe forgot 'Illuminate\View\ViewServiceProvider' in your service providers?
Ah it works! I started again from scratch for the third time and this time i got it working, unfortunately i'm not 100% sure what I did different. Appreciate your help and if I figure out what I did different I'll comment.
I'm trying to get this working but my presenter functions don't work. How do I go about debugging this?
This is how i pass the user object to my view and since I implemented getPresenter it seems that all that I should have to do? (using sentry 2)
I've extended my model to