Results 1 to 3 of 3

Thread: Know if the class can be instantiated

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Resolved Know if the class can be instantiated

    I have a concatenation like

    list($dummy, $class, $action) = split('/', $_SERVER['PATH_INFO']);
    $class = ucfirst($class) . 'Controller';
    $controller = new $class;

    So if I'll pass /post I can have PostController but if the PostController doesn't exist, how do I know that so that I can't new $class coz it gives Cannot instantiate non-existent class: postcontroller?

    Thanks in advance.
    Last edited by nebulom; Aug 3rd, 2007 at 12:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width