コード例 #1
0
ファイル: Anchor.php プロジェクト: rcastardo/mvc-na-pratica
 /**
  * @param	string $href
  */
 public function __construct($href = null)
 {
     parent::__construct();
     if (!is_null($href)) {
         $this->setHref($href);
     }
 }
コード例 #2
0
ファイル: Label.php プロジェクト: rcastardo/mvc-na-pratica
 /**
  * @param	Component $label
  */
 public function __construct(Component $label = null)
 {
     parent::__construct();
     if (!is_null($label)) {
         $this->addChild($label);
     }
 }
コード例 #3
0
ファイル: Heading.php プロジェクト: rcastardo/mvc-na-pratica
 /**
  * @param	integer $level
  * @throws	UnexpectedValueException Se $level não for um inteiro
  * 			no intervalo de 1 até 6.
  */
 public function __construct($level = 1)
 {
     parent::__construct();
     if (is_int($level) && $level >= 1 && $level <= 6) {
         $this->level = $level;
     } else {
         throw new UnexpectedValueException('$level precisa ser um inteiro entre 1 e 6 inclusive.');
     }
 }
コード例 #4
0
ファイル: Form.php プロジェクト: rcastardo/mvc-na-pratica
 /**
  * @param	string $action Ação do formulário.
  * @param	string $method Método de envio do formulário.
  */
 public function __construct($action, $method = 'post')
 {
     parent::__construct();
     $this->setAction($action);
     $this->setMethod($method);
 }
コード例 #5
0
ファイル: Input.php プロジェクト: rcastardo/mvc-na-pratica
 /**
  * @param	string $name Nome do input
  * @param	string $type Tipo do input
  */
 public function __construct($name, $type = Input::TEXT)
 {
     parent::__construct();
     $this->setName($name);
     $this->setType($type);
 }