Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stub some input stuff

  • Loading branch information...
commit 3cb6d17fbb6a87c9557d52436a069557c06691ac 1 parent f7a2d4b
Brennen Bearnes authored
Showing with 63 additions and 0 deletions.
  1. +21 −0 HTML/Input.php
  2. +42 −0 HTML/Input/Select.php
View
21 HTML/Input.php
@@ -0,0 +1,21 @@
+<?php
+namespace SparkLib\HTML;
+
+abstract class Input {
+
+ protected $_html;
+
+ public static function make ()
+ {
+ $class = get_called_class();
+ return new $class;
+ }
+
+ public function __toString ()
+ {
+ return $this->render();
+ }
+
+ abstract public function render();
+
+}
View
42 HTML/Input/Select.php
@@ -0,0 +1,42 @@
+<?php
+namespace SparkLib\HTML\Input;
+use \SparkLib\HTML;
+use \SparkLib\Iterator;
+
+class Select extends \SparkLib\HTML\Input {
+
+ protected $_options;
+ protected $_output;
+ protected $_value;
+ protected $_title;
+
+ public function __construct ()
+ {
+ }
+
+ public function options ($options)
+ {
+ $this->_options = $options;
+ return $this;
+ }
+
+ public function value ($value)
+ {
+ $this->_value = $value;
+ return $this;
+ }
+
+ public function title ($title)
+ {
+ $this->_title = $title;
+ return $this;
+ }
+
+ public function render ()
+ {
+ if (! isset($this->_output)) {
+ $this->_output = implode('', $this->_options->map(function ($thing) { return $thing->parts_tier_name; }));
+ }
+ return $this->_output;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.