Advertisement
Guest User

stackoverflow explanation of question 11111170

a guest
Jun 20th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2.  
  3. # http://stackoverflow.com/questions/11111170/the-concept-of-an-object-variable-in-typoscript
  4.  
  5. class Menu {
  6.   public $pid;
  7.  
  8.   function render() {
  9.     // code to render the menu
  10.   }
  11. }
  12.  
  13. $page = new Page();
  14. $menu = new Menu();
  15.  
  16. $menu->pid = 2345;
  17. $page->add($menu); // adds a list of subpages from 2345 to the page
  18.  
  19. $menu->pid = 3456;
  20. $page->add($menu);
  21.  
  22. echo $page->display();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement