[FEATURE] Added Input classes from pecee-framework.

- Updated documentation to reflect new changes.
This commit is contained in:
Simon Sessingø
2016-04-15 23:07:51 +02:00
parent 7a429cec1d
commit 17adfb8aa4
6 changed files with 472 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
<?php
namespace Pecee\Http\Input;
class InputItem {
protected $index;
protected $name;
protected $value;
public function __construct($index, $value) {
$this->index = $index;
$this->value = $value;
// Make the name human friendly, by replace _ with space
$this->name = ucfirst(str_replace('_', ' ', $this->index));
}
/**
* @return array
*/
public function getName() {
return $this->name;
}
/**
* @return array
*/
public function getValue() {
return $this->value;
}
/**
* @return string
*/
public function getIndex() {
return $this->index;
}
/**
* Set input name
* @param string $name
* @return static $this
*/
public function setName($name) {
$this->name = $name;
return $this;
}
public function __toString() {
return (string)$this->getValue();
}
}