The slots are very fast. The slot() function is just a wrapper around 
ob_start(). The end_slot() is a wrapper to ob_get_clean(). And when you 
include_slot() later, it just outputs the slot content. So, slots are 
very very fast.

On the other hand, partials are a bit slower because they involve a view 
rendering but nonetheless they are very fast too.

Fabien

Hadrien Boyé wrote:
> Hi all,
> 
> i wonder how can i optimize the performances of the view generation 
> process inside my application. i extensively use 'partials' and 'slots' 
> to compose the view of my app
> 
> the pages of my applications are composed of several tabs, which display 
> their content when the user is clicking on it (via hide / show in JS).
> Each page is composed by a specific View which defines one slot per tab 
> content. in each slot a "partial view" is called.
> 
> example : showSuccess.php
> [code]
>   ...
>   $tab_list[] = "Identification";
>   slot('Identification');
>     echo include_partial('contrat/identification', array('contrat' => 
> $contrat));
>   end_slot();
>   ...
>   $tab_list[] = "Autorisations";
>   slot('Autorisations');
>     echo include_partial('contrat/solutions',array('contrat' => $contrat));
>   end_slot();
>   ...
>   // generating page content
>   page_content($tab_list);
>   ...
> [/code]
> 
> [code]
>   // the 'page_content' function (simplified)
>   function page_content($tabList = array()){
>     if(count($tabList) < 1) { return null; }
>     echo '<div id="content-tabs">';
>     foreach($tabList as $tabNum => $tabName){
>       echo '<div id="content-tab'.$tabNum.'" class="content-tab" >';
>         include_slot($tabName);
>       echo '</div>';
>     }
>     echo '</div>';
>   }
> [/code]
> 
> does it affects performances ? how can the tab content layout generation 
> could be optimized ?
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to