I am trying to utilize the popular HTML DOM parser (http://simplehtmldom.sourceforge.net/manual.htm) as a helper in this small EE plugin I’m trying to write. I load it as such:
$this->EE->load->helper('domparser');When I load the file I get:
Fatal error: Cannot redeclare class simple_html_dom_node in /var/www/vhosts/dev.cwk.upshotstaging.net/httpdocs/2s1C98Mc9vmg27/expressionengine/helpers/domparser_helper.php on line 43
Huh? Am I missing something? Does ExpressionEngine already have this baked in? I’ve searched the whole site for “simple_html_dom” and it’s not located anywhere else.
upshot,
Did you create the file domparser_helper.php? We don’t have anything like that in CodeIgniter or ExpressionEngine, so I’m guessing you made it. Looking at the package, you should probably be including it using include_once:
include_once('simple_html_dom.php');And that should be in the same directory as your plugin in the system/expressionengine/third_party directory. If you wanted to be a bit tidier, maybe even create a libraries folder and put it in there.
Try that and see if you still get that error.
Wes
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.