api calls within if statemets

Quick question here. Am I safe to assume that api calls within if() statements won’t get executed unless the condition is met.

As in if($template==“index.php”){getContent(...);}

Yep, you’re completely correct.

Justin “Jark” Stayton
Monk Development

Cool. How about when creating new functions to be called later

function writePageContent() { getContent(...); }

Would the api lookup only take place when the function is called or when it is first defined?

Only when the function is called.

Justin “Jark” Stayton
Monk Development

page 1 of 1

discussions 1 to 4 of 4