Extend Autonav controller

Permalink
Hi

I am trying to change some functionality of the Autonav block. Given the controller looks like this

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   class AutonavBlockController extends Concrete5_Controller_Block_Autonav { }
   class AutonavBlockItem extends Concrete5_Controller_Block_AutonavItem { }


And I want to override the getUrl() method in AutonavBlockItem, what do I need to place in my blocks/autonav/controller.php file?

I have tried this, but it does not execute/die, but still loads.

<?php 
   defined('C5_EXECUTE') or die("Access Denied.");
   class AutonavBlockController extends Concrete5_Controller_Block_Autonav { }
   class AutonavBlockItem extends Concrete5_Controller_Block_AutonavItem
   {    
       /** 
       * Gets a URL that will take the user to this particular page. Checks against URL_REWRITING, the page's path, etc..
       * @return string $url
       */
      function getURL() {
         die();
         $dispatcher = '';
         if (!URL_REWRITING) {
            $dispatcher = '/' . DISPATCHER_FILENAME;
         }


Thanks

yolk
 
yolk replied on at Permalink Reply
yolk
goutnet replied on at Permalink Reply
If you are copying the block to modify it, you can change the default behavior by changing the protected :

protected $btCacheBlockOutput = false;
   protected $btCacheBlockOutputOnPost = false;
   protected $btCacheBlockOutputForRegisteredUsers = false;