Redeclared Function Error
Permalink
I've got a custom block that I need to be able to call twice per page, but I'm getting a PHP error stating that I can't redeclare a function contained in controller.php in the second instance of that block.
How would I get around this? Would includes work? I'm not terribly proficient with PHP.
Thanks!
How would I get around this? Would includes work? I'm not terribly proficient with PHP.
Thanks!
Currently nothing is being called via include. I wasn't sure if calling a file that contained the function via include would keep it from being defined twice or not?
Here's a link to the site:
http://www.elenmir.com/index.php?cID=97...
I'm trying to call it once in the top left corner and again in the content section, but eventually I want to move that to the top right side. Just want to get this error fixed first = )
Here's a link to the site:
http://www.elenmir.com/index.php?cID=97...
I'm trying to call it once in the top left corner and again in the content section, but eventually I want to move that to the top right side. Just want to get this error fixed first = )
could you attach or email the controller file?
And in the page you are just using this block twice and getting this error correct?
And in the page you are just using this block twice and getting this error correct?
When I tried to attach it, I was told .php is an invalid file extension.
Yes, I'm using that block twice.
Yes, I'm using that block twice.
I'll post the code here.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class EtsyConcreteBlockController extends BlockController { var $pobj; protected $btDescription = "Test Block to Access Etsy API"; protected $btName = "Etsy Concrete"; protected $btTable = 'btEtsyConcrete'; protected $btInterfaceWidth = "350"; protected $btInterfaceHeight = "300"; function __construct($obj = null) { parent::__construct($obj); $this->set('showeditmode',$this->showeditmode); } function url(){ return $this->url; }
Viewing 15 lines of 216 lines. View entire code block.
defined('C5_EXECUTE') or die(_("Access Denied.")); class EtsyConcreteBlockController extends BlockController { var $pobj; protected $btDescription = "Test Block to Access Etsy API"; protected $btName = "Etsy Concrete"; protected $btTable = 'btEtsyConcrete'; protected $btInterfaceWidth = "350"; protected $btInterfaceHeight = "300"; function __construct($obj = null) { parent::__construct($obj); $this->set('showeditmode',$this->showeditmode); } function url(){ return $this->url; } function processRequest()
Viewing 15 lines of 214 lines. View entire code block.
Are you including additional php files in the controller?
If you are then perhaps you can use the include_once directive rather than include.