I've noticed several examples of code like this:
if (!$may_cache){
45 $items[] = array (
46 'path' => 'node/add/demo',
47 'title' => t('demo'),
48 'access' => user_access('create demo'),
49 );
50 $items[] = array (
51 'path' => 'demo/example',
52 'callback' => '_demo_show',
53 'access' => user_access('view example'),
54 'type' => MENU_CALLBACK,
55 );
...
It seems to me that $items is being instantiated and then immediately overwritten with new values. What is going on here? Is $items[] an array of two arrays?
Comments
Creating/modifying with square-bracket syntax
See http://www.php.net/manual/en/language.types.array.php :
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.