We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Cannot redeclare class simple_html_dom_node

Development and Programming

upshot's avatar
upshot
85 posts
14 years ago
upshot's avatar upshot

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.

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.