Posted By

kevincam on 05/31/12


Tagged

display cache joomla


Versions (?)

Base display function to use Joomla! cache


 / Published in: PHP
 

This is a base function to use with Joomla! to display the view using the Joomla cache system.

  1. /**
  2.  * Method to display a view.
  3.  *
  4.  * @param boolean If true, the view output will be cached
  5.  * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  6.  *
  7.  * @return JController This object to support chaining.
  8.  * @since 1.5
  9.  */
  10. public function display($cachable = false, $urlparams = false)
  11. {
  12. $cachable = true;
  13.  
  14. // Get the document object.
  15. $document = JFactory::getDocument();
  16.  
  17. $safeurlparams = array('catid'=>'INT', 'id'=>'INT', 'cid'=>'ARRAY', 'year'=>'INT', 'month'=>'INT', 'limit'=>'INT', 'limitstart'=>'INT', 'showall'=>'INT', 'return'=>'BASE64', 'filter'=>'STRING', 'filter_order'=>'CMD', 'filter_order_Dir'=>'CMD', 'filter-search'=>'STRING', 'print'=>'BOOLEAN', 'lang'=>'CMD');
  18.  
  19. parent::display($cachable, $safeurlparams);
  20.  
  21. return $this;
  22. }

Report this snippet  

You need to login to post a comment.