Servant

Sample 1: Empty input

initialization()
$input1 = $servant->create()->input()
pointer()
$input1->pointer()
array (
)
stringPointer()
$input1->stringPointer()
''

Sample 2: Quickly initialize input with pointer

initialization()
$input2 = $servant->create()->input("foo", "bar")
fetch($key, $format, $default = null)
$input2->fetch("foo", "string")
formats()
$input2->formats()
array (
  0 => 'string',
  1 => 'base64',
  2 => 'email',
  3 => 'fulltext',
  4 => 'id',
  5 => 'json',
  6 => 'oneliner',
  7 => 'hash',
  8 => 'flathash',
  9 => 'queue',
  10 => 'ids',
)
pointer()
$input2->pointer()
array (
)
stringPointer()
$input2->stringPointer()
''

Sample 3: Full control over input

initialization()
'$input3 = servant->create()->input(
	array(
		"pointer" => array(
			"foo",
			"bar",
		),
	),
	array(
		"anykey" => "some string value",
		"someOtherKey" => array(1, 2, 3),
	)
)'
fetch($key, $format, $default = null)
$input3->fetch("anykey", "string")
'some string value'
formats()
$input3->formats()
array (
  0 => 'string',
  1 => 'base64',
  2 => 'email',
  3 => 'fulltext',
  4 => 'id',
  5 => 'json',
  6 => 'oneliner',
  7 => 'hash',
  8 => 'flathash',
  9 => 'queue',
  10 => 'ids',
)
pointer()
$input3->pointer()
array (
  0 => 'bar',
)
stringPointer()
$input3->stringPointer()
'bar'