davzie / laravel-bootstrap

[DEPRECATED] A Laravel 4, Bootstrap 3 CMS Built With SOLID Principles In Mind
Other
558 stars 171 forks source link

Show posts, galleries etc #4

Closed luki922 closed 11 years ago

luki922 commented 11 years ago

I need write new controller for show posts, galleries form database in front-end?

davzie commented 11 years ago

Hi Luki,

The front-end code is whatever you make it. You can access the data by using the bound class in a controller:

public function __construct ( Davzie\LaravelBootstrap\Posts\PostsInterface $posts ){ $this->model = $posts; }

public function getIndex() { return $this->model->getAll(); }

Or you can access it anywhere using the IoC Container:

$postsModel = App::make( 'Davzie\LaravelBootstrap\Posts\PostsInterface' );

Dave

grayxr commented 10 years ago

Do you know how I would go about implementing pagination with posts? Is that not included with this package?

I apologize if i'm annoying you at all, i'm having questions because I'm building a site with this package. :)

davzie commented 10 years ago

You’ll need to perhaps take this package and create your own slant on things, taking it out of composer’s ability to update and overwrite your changes etc.

I think the base controller has a getIndex() method that gets the objects.

I guess there you’d need to do some pagination on the object based on get parameters or something. Apologies for the vagueness, it’s been a while since I looked at this project and I’m concentrating on stuff that makes me money :(

I’m just one of those ass-hole Open Source guys who don’t support the code they put out haha, sorry!

On 3 December 2013 at 00:37:30, James Gray (notifications@github.com) wrote:

Do you know how I would go about implementing pagination with posts? Is that not included with this package?

I apologize if i'm annoying you at all, i'm having questions because I'm building a site with this package. :)

— Reply to this email directly or view it on GitHub.

grayxr commented 10 years ago

No need to apologize - thanks for your help, God bless.