Beispiel #1
0
 public function post($name = NULL)
 {
     $post = Tart_Request::post($this->request->post(), $_FILES);
     if ($name !== NULL) {
         return Arr::get($post, $name);
     }
     return $post;
 }
Beispiel #2
0
 public static function to_modifications(array $modified)
 {
     foreach ($modified as $key => &$value) {
         $value = Inflector::humanize($key) . (is_array($value) ? ': ' . Tart_Request::to_modifications($value) : ($value ? ' set to "' . $value . '"' : ' cleared'));
     }
     return Tart::to_sentence(array_values($modified));
 }
Beispiel #3
0
 public function test_to_modifications()
 {
     $data = array('name' => 'Parent', 'test' => NULL, 'folder' => array('name' => 'Best', 'subtitle' => NULL));
     $expected = 'name set to "Parent", test cleared and folder: name set to "Best" and subtitle cleared';
     $this->assertEquals($expected, Tart_Request::to_modifications($data));
 }