Hello,

I am wondering why helpers are functions (and not classes with static
methods), and why template are flat php files and not classes with
methods (that output response) ?

Example for helpers :
<?php use_helper('Text') ?>//will auto load our Helper class

<?php echo TextHelper::ttransformTWhatIWant($myString); ?>//call a
static method


Example for templates (and partials) :

Instead of "just" including the template file, call the corresponding
class :
$template = new MyActionSuccesTemplate($vars);//create template and
load vars to be accessible from methods
$template->render();

//Template filds could become :
class MyActionSuccesTemplate axtends sfTemplate {

 public function render() {
   echo "bla";
   echo $this->getVar('varName');
   if( TRUE ) {
     $this->displaySometing();
   }

}

   protected function displaySomething(){
      echo 'bla again';
   }

}


I hope thats clear (sorry for my english). I think a templating system
like that could be very much more powerful than simple functions and
flat PHP files, and shouldn't be very hard to implement.

I would be happy to have your comments on that :p


Romain

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to