1. <?php
  2. // Single Array Complex Example
  3. $plugins['hello_world'] = array(
  4. 'pages' => array(
  5. 'General Greeting' => array(
  6. 'route' => array(
  7. '/hello' => 'pageHelloComplex'
  8. ),
  9. 'permissions' => array(
  10. 'View Greeting' => true
  11. ),
  12. ),
  13. ),
  14. 'blocks' => array(
  15. 'Specific Greeting' => array(
  16. 'route' => 'blockHelloComplex',
  17. 'permissions' => array(
  18. 'View Block' => true
  19. ),
  20. ),
  21. ),
  22. );
  23. function pageHelloComplex()
  24. {
  25. $body = new Template("general_greeting.tpl.php");
  26. }
  27. // Contents of 'general_greeting.tpl.php' -
  28. // <h1>Hello World!</h1>
  29. // Output:
  30. // Hello World!
  31. function blockHelloComplex()
  32. {
  33. $body = new Template("specific_greeting.tpl.php");
  34. }
  35. // Contents of 'specific_greeting.tpl.php' -
  36. // <h1>Hello John!</h1>
  37. // Output:
  38. // Hello John!
  39. // Let's look at the resulting array
  40. echo "<br />This is an example of the complex way to build the array: <br />";
  41. echo "<pre>";
  42. echo print_r($plugins);
  43. echo "</pre>";

Single Array Complex Example