public function action_add_item($feed_id) { $form = Uniform::factory('Krss_Item'); //check form and feed if ($form->sent() and $data = $form->bind($_POST)->check() and $feed = Jelly::select('krss_feed', $feed_id) and $feed->loaded()) { $data['feed'] = $feed; Jelly::factory('krss_item')->set($data)->save(); $redirect_to = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : KRSS . '/feed/show/' . $feed_id; Url::redirect($redirect_to); } $this->template->content = View::factory('krss/add_item')->set(array('form' => $form)); }
public function add_form($form_name, $fields = NULL) { $form = is_object($form_name) ? $form_name : Uniform::factory($form_name); $this->_fields += $form->_fields; return $this; }
/** * @dataProvider dataProviderForMean */ public function testMean($a, $b, $μ) { $this->assertEquals($μ, Uniform::mean($a, $b), '', 1.0E-5); }