public function useTemplate($template_name = false)
    {
        $templates = $this->getTemplates();

        // set the default template
        if ($template_name == false) {
            $template_name = $templates[0]->name;
        }

        // actually use the template
        if ($template_name) {
            $this->{$template_name}();
        }
    }
public function useTemplate($template_name = false)
    {
        $templates = $this->getTemplates();

        // set the default template
        if ($template_name == false) {
            $template_name = $templates[0]->name;
        }

        // actually use the template
        if ($template_name) {
            $this->{$template_name}();
        }
    }
public function useTemplate ( $ template_name = false ) { $ templates = $ this -> getTemplates ( ) ; // set the default template
 if ( $ template_name == false ) { $ template_name = $ templates [ 0 ] -> name ; } // actually use the template
 if ( $ template_name ) { $ this -> { $ template_name } ( ) ; } }
Add the fields defined for a specific template.

@param  string $template_name The name of the template that should be used in the current form.
Add the fields defined for a specific template .