public function action_index($page = 1)
{
$config = array(
'pagination_url' => static::$data['base_url'].'admin/testing/',
'total_items' => 2,
'per_page' => 1,
'uri_segment' => 3,
);
// Config::set('pagination', $config); // you can use this too!
Pagination::set_config($config);
static::$data['pagination_links'] = Pagination::create_links();
// I fetch only one post 'cause i'm just testing
static::$data['posts'] = Post::get($page);
return Response::forge(View::forge('home/index.twig', self::$data));
}
{% from "structures/post.twig" import postbody%}
{% for post in posts %}
{{ postbody(post) }}
{% endfor %}
{{ pagination_links }}
I also tryed to use {{ pagination_links|raw }} to prevent html escape but still not working
(Sorry bad english) // Config::set('pagination', $config); // you can use this too! Pagination::set_config($config);
static::$data['posts'] = Post::get($page);
return Response::forge(View::forge('home/index.twig', self::$data)->set('pagination_links', Pagination::create_links(), false));
It looks like you're new here. If you want to get involved, click one of these buttons!