1. Home
  2. Docs
  3. Developer Documentations
  4. Pager Filters

Pager Filters

Pager Filters

Pager filters give you the option to set what must be met before a Pager can be loaded for example in crea8socialpRO  some pages will required authentication before you can assess the pages, using the auth will save your ass

register_pager(“user/settings”, array(‘use’ => “page/user/settings@settings_page”, ‘filter’ => ‘auth’, ‘as’ => ‘user-settings’));

and you can register your filter for example in the code below

  register_filter(‘filter-name’, function(){
//your filter code here
});

Your filter code must return boolean  true to allow loading of the page else false 

and you can use it in your pager registration

register_pager(‘test/plugin/page’, array(‘as’ => ‘test-plugin-url’, ‘use’ => ‘test::mypage@index_pager’, ‘filter’ => ‘filter-name’));

Thats all and thanks for reading

Was this article helpful to you? Yes No

How can we help?