What made the $categories variable global ? (Technics)

by Leon @, Friday, January 23, 2009, 03:17 (5544 days ago)

Hello guys,


I know this question may make me sound very amateurish, but being amateurish I'm so eager to have someone's help hands during my tedious study:-(

I know the the $categories variable got asigned with value at the first place with below statements in main.inc.php:

==============
$categories = get_categories();
==============

Now my question is:- What made the variable Global? Why can we re-use the $categories variable directly in posting.inc.php without haveing to assign value to it again ?

What kinds of technologies and which files did the trick ?

Any detailed explanation would be highly appreciated.

locked
3854 views

What made the $categories variable global ?

by yan, Friday, January 23, 2009, 04:58 (5544 days ago) @ Leon

This command in index.php
if(isset($categories)) $smarty->assign('categories', $categories);

locked
3734 views

What made the $categories variable global ?

by Leon, Friday, January 23, 2009, 14:11 (5544 days ago) @ yan

Thanks very much! That's it!

locked
3651 views

RSS Feed of thread