php - Kohana 3 Pagination & Route question -


this bit cryptic, on day 1. use if dont mind. controller search, on action_query($search_term)

so right /search/query/some query?page=1 (this without route) need setup in format..

/search/some query/1
1 being page pagination

        $pagination = pagination::factory(array(             'current_page'      => array('source' => 'route', 'key' => 'page'),             'total_items'       => $count,             'items_per_page'    => 100,             'view'              => 'pagination/basic',           )); 

with route

 route::set('page', '<controller>/<action>/<search_term>(/<page>)')     ->defaults(array(         'action' => 'query',         'search_term' => '[a-za-z0-9 ]',         'controller' => 'search',         'action' => 'page',         'page' => '1',     ) ); 

i have pagination working , route looks like:

route::set('comments', 'welcome/index(/<page>)', array('page' => '[0-9]+')) ->defaults(array(     'controller' => 'welcome',     'action'     => 'index' )); 

also, think missing parameter when creating paginator, is:

'uri_segment'    => 'page', // pass string uri_segment trigger former 'label' functionality. 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -