I have a class for building forms and I want to upgrade it to handle Bootstrap. I'd like to use my current methods to build the Bootstrap elements, but I don't want all of this new Bootstrap code cluttering up my current Forms class, so I'd like to put it into its own class in a separate file.

Below is a very simple example; obviously this doesn't work and the code is wrong, however, from this you can hopefully see what I'm trying to accomplish.


PHP Code:
<?php
class Forms {
    
    public function 
input_text($name) {
        return 
'<input type="text" name="'.$name.'">';
    }
}


class 
Bootstrap {
    
    public function 
bootstrap_input_text($name,$label) {
        
$return  '<div class="control-group">';
        
$return .= '<label class="control-label" for="'.$name.'">'.$label.'</label>';
        
$return .= '<div class="controls">';
        
        
// use the input_text() method from the Forms class
        
$return .= $this->Forms->input_text($name);
        
        
$return .= '</div>';
        
$return .= '</div>';
        return 
$return;
    }
}


$form = new Forms();

echo 
$form->input_text('name');
echo 
$form->bootstrap_input_text('email','Email');