note 25215 added to ref.classobj

From: Date: Sat, 14 Sep 2002 17:35:25 +0000
Subject: note 25215 added to ref.classobj
Groups: php.notes 
Request: Send a blank email to php-notes+get-36684@lists.php.net to get a copy of this message
You may find it helpful in complex projects to have namespaces for your classes, and arrange these in a hierarchical manner. A simple way to do this is to use the filesystem to order your hierarchies and then define a function like this: function use_namespace($namespace){ require_once("namespaces/$namespace.obj.php"); } (lack of indentation due to HTML UI for this page) This requires that all your object libraries end in .obj.php (which I use) but you can modfy it to suit your needs. To call it you could, for exmaple call: use_namespace("example"); or if foo is part of example you can call: use_namespace("example/foo"); -- http://www.php.net/manual/en/ref.classobj.php http://master.php.net/manage/user-notes.php?action=edit+25215 http://master.php.net/manage/user-notes.php?action=delete+25215 http://master.php.net/manage/user-notes.php?action=reject+25215

« previous php.notes (#36684) next »