View Single Post
Old 11-17-2007, 02:26 PM   #5 (permalink)
Morishani
The Contributor
 
Join Date: Nov 2007
Posts: 32
Thanks: 5
Morishani is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Inside your table class, just add a member variable which is an instance of the columns class.

For example (only an example!):
PHP Code:
class table
{
    public 
$columns;
    public function 
__construct()
    {
        
$this->columns = new columns();
    }
}

// Then you can do:
$table = new table();
$table->columns->add('asdf'); 
Thats one nice way, but after that you can also do :
PHP Code:
//main code, not inside a class :
$columns = new columns();
$columns->add("asdf"); 
And I don't want that, but if there is no way to delete this privilege then I may use your way.

So, Salathe, what do you say?

Also, if i use your way, is there anyway to get to the "parent element" from columns class? (so i can reach "table" class from "columns" class functions)
Send a message via ICQ to Morishani Send a message via MSN to Morishani
Morishani is offline  
Reply With Quote