Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / General / PHP callbacks, the drawbacks?

foxhound
#38760 2013-12-10 12:35

I am using a few (say 10 PHP callbacks) in a list.tpl which creates an output of pages for me which I want to display on top of the list, depending where you are.

But, as you all know an easy way has its downside as well so I was actually curios about the statement made on the page explaining about the PHP callbacks: 
http://www.cotonti.com/docs/ext/themes/cotemplate_advanced

You write: "Putting logic in your template has some drawbacks. Firstly, it's slow if used a lot....... "
But, what is  'a lot" speaking about those callbacks? Is 10 a lot? Or with a lot I should more think of 100's callbacks in a tpl?

Does "a lot" also depend on the kind of callback you are doing?
Like for example I am using one to get a specific date in my title and 10 others to output different data depending on your location on the site, so it wont output all 10 data's at the same time.

Does "a lot" also depend on how active your website is? Meaning if you have 10 pageviews a day you can make 1000 php callbacksin a tpl but if you have 500000 pageviews you should only make 1 php callback in a single tpl?

Does it also depend one in how many different tpl's you actually use them?


I hope to get some more info about this so I know a bit more about the do's and don'ts of the php callbacks :)

<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />