Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7052109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:20:39+00:00 2026-05-28T03:20:39+00:00

I am trying to add an external library (PHP Simple DOM Parser, http://simplehtmldom.sourceforge.net/index.htm )

  • 0

I am trying to add an external library (PHP Simple DOM Parser, http://simplehtmldom.sourceforge.net/index.htm) to a Symfony2 project. I took a tutorial that explains how to include third party libraries to Symfony2 http://www.kiwwito.com/article/add-third-party-libraries-to-symfony-2.

I set up a class file like:

# vendor/phpsimpledom/lib/Phpsimpledom/simple_html_dom.php

require_once __DIR__.'/src/simple_html_dom.php';

class Phpsimpledom_Phpsimpledom extends simple_html_dom_node {
}

and registered my class in my Autoloader (autoload.php):

$loader->registerNamespaces(array(
...
'Phpsimpledom' => __DIR__.'/../vendor/phpsimpledom/lib/',
...
),));

I am trying to call:

$phpsimpledom = new \Phpsimpledom();

but this throughs me an error (Fatal error: Class ‘simple_html_dom_node’ not found).

However: The main file of the library (simple_html_dom.php) consists of functions that do not belong to a class.

When I try to use the file directly, it also doesn’t work:

    $loader->registerNamespaces(array(
...
'Phpsimpledom' => __DIR__.'/../vendor/phpsimpledom/lib/Phpsimpledom/src/simple_html_dom.php',
...
),));

Any hints?

THANKS!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:20:40+00:00Added an answer on May 28, 2026 at 3:20 am

    You’re trying to register a namespace but your class has no namespace. Try adding a namespace to it or use RegisterPrefixes().

    BTW: did you know that one of the Symfony components is basically doing the same thing as php simpledom? It’s called DomCrawler and it has a support for both xpath and CSS selectors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just starting to poke around iPhone development. I am trying to add an external
I am trying to add a sound library to a GLFW / OpenGL project
I'm trying to add a very simple action to the context menu of Eclipse:
I am trying to wrap an external library in more idiomatic Clojure. This includes
I'm trying to add an external repo as a submodule of my repo, so
I'm trying to add an external icon from an *.ico file to a window
I'm trying to add a custom HTTP Validator as shown here . I want
I'm having a silly problem : I'm trying to add the Jsoup library (which
I'm trying to add external JAR file to eclipse android project. JAR package have
I'm trying to add a web reference to an external Axis - generated web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.