Daniel, come in and have doubts
Like writing an infinite navigation class.
PHP Code
Array (' id ' =>1, ' pid ' =>0, ' name ' = ' Home ' ), array ( ' id ' =>2, ' PID ' =>0, ' name ' = ' News ' )
Data such as this is initialized class when there is a class attribute or need to be read in (database or file line), the key is to consider memory efficiency that way better
Description
1, because is the navigation, therefore will frequently call
2, this data will compare more, tree structure is greater than 3, estimated in 6 appearance
------Solution--------------------
It's better to read in when you need it, and the speed performance will be higher.
Http://baike.baidu.com/view/1617569.htm
------Solution--------------------
Explore
Like writing an infinite navigation class.
PHP Code
Array
Array
' ID ' =>1,
' PID ' =>0,
' Name ' = ' Home '
),
Array
' ID ' =>2,
' PID ' =>0,
' Name ' = ' News '
)
------Solution--------------------
Most of this navigation has to do with directories and files, and what to maintain later, so the data correspondence should be stored through the database
Then generate the file and include the file when needed.
------Solution--------------------
Write Cache Ah, if there is memcached, write directly in, otherwise the file cache can also
------Solution--------------------
discuss
Write the class attribute (the initialization exists), and load when needed (certainly will be loaded, but should say a little later than the class attribute), in addition to the difference in time, there is no other difference?