HosipLan

Untitled

Mar 21st, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. namespace {
  4.  
  5.     require_once 'Nette/loader.php';
  6.     Nette\Diagnostics\Debugger::enable();
  7.     Nette\Diagnostics\Debugger::$strictMode = TRUE;
  8.  
  9.     $container = new Nette\Forms\Container;
  10.     $text = $container->addText('name');
  11.  
  12.     dump($container);
  13.  
  14. }
  15.  
  16.  
  17. namespace Nette\Forms {
  18.  
  19.     use Nette;
  20.  
  21.     class Container
  22.     {
  23.         private $controls;
  24.  
  25.         /** @return Nette\Forms\Controls\TextInput */
  26.         public function addText($name)
  27.         {
  28.             return $this->controls[$name] = new Controls\TextInput;
  29.         }
  30.     }
  31.  
  32. }
  33.  
  34. //----------------------------------------
  35.  
  36. namespace Nette\Forms\Controls {
  37.  
  38.     class TextInput
  39.     {
  40.         private $value;
  41.  
  42.         /** @return string */
  43.         public function getValue()
  44.         {
  45.             return $this->value;
  46.         }
  47.     }
  48.  
  49. }
  50.  
  51.  
  52. #### output
  53.  
  54.  
  55. Nette\Forms\Container(1) {
  56.    controls private => array(1) {
  57.       name => Nette\Forms\Controls\TextInput(1) {
  58.          value private => NULL
  59.       }
  60.    }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment