Guest User

IControl render fail

a guest
Aug 11th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @outputMatch ~Call to undefined method.*setOption\(\)~
  5.  * @exitCode 255
  6.  */
  7.  
  8. use Nette\ComponentModel\IComponent;
  9. use Nette\ComponentModel\IContainer;
  10. use Nette\Forms\Form;
  11. use Nette\Forms\IControl;
  12.  
  13. require '../bootstrap.php';
  14.  
  15. class FooControl implements IControl, IComponent
  16. {
  17.     private $parent;
  18.     private $name;
  19.  
  20.     function setValue($value)
  21.     {
  22.     }
  23.  
  24.     function getValue()
  25.     {
  26.         return 'foo';
  27.     }
  28.  
  29.     function validate()
  30.     {
  31.     }
  32.  
  33.     function getErrors()
  34.     {
  35.         return [];
  36.     }
  37.  
  38.     function isOmitted()
  39.     {
  40.         return FALSE;
  41.     }
  42.  
  43.     function getName()
  44.     {
  45.         return $this->name;
  46.     }
  47.  
  48.     function getParent()
  49.     {
  50.         return $this->parent;
  51.     }
  52.  
  53.     function setParent(IContainer $parent = NULL, $name = NULL)
  54.     {
  55.         $this->parent = $parent;
  56.         $this->name = $name;
  57.     }
  58. }
  59.  
  60. $form = new Form;
  61. $form->addComponent(new FooControl, 'foo');
  62.  
  63. $form->render();
Advertisement
Add Comment
Please, Sign In to add comment