Components\Posts\Controllers\PostsController::index PHP Method

index() public method

Display a listing of the posts.
public index ( ) : Response
return Response
    public function index()
    {
        $posts = Post::type($this->type)->target('public')->published()->recent()->paginate(5);
        if ($this->type == 'post') {
            $title = trans('cms.posts');
        } else {
            $title = trans('cms.pages');
        }
        $this->layout->title = $title;
        $this->layout->content = View::make('public.' . $this->current_theme . '.posts.index')->with('title', $title)->with('posts', $posts)->with('type', $this->type);
    }