Im still green with writing with class, but I just want to check with
you all.
I started creating a class file that also using 2 other classes.
class.php
-----------------------------------
<?php

class foo
{
     function foo()
     {
         require_once('./this.class.php');
         $this->db_obj = &new abc($db);

         require_once('./that.class.php');
         $this->tpl_obj = &new xwy;
     }
}

?>
----------------------------------

Then in my actual page I started this
----------------------------------
<?php

require_once('./class.php');
$bar = new foo();

$bar->db_obj->run_some_code($bar);
$bar->tpl_obj->do_this_for_me($bar);

?>
------------------------------------

It works but was wondering if its 'legal' to use it like this ->
$lcre->db_obj->run_some_code($bar);
$lcre->tpl_obj->do_this_for_me($bar);

Im not extending the classes, just using them, so is what Im doing ok??
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to