/** * Generates an HTML radio list. * * @param array $options * @param string $name * @param array $selected * @param array $attrs * @param bool|false $tpl * @return string */ public function render(array $options, $name, $selected = array(), array $attrs = array(), $tpl = false) { if (is_array($selected)) { $last = Arr::last($selected); $selectedVal = Arr::in($last, $selected) ? $last : null; list($options, $selected) = $this->_checkSelected($options, $selectedVal); } if (is_string($selected)) { list($options, $selected) = $this->_checkSelected($options, $selected); } return parent::render($options, $name, $selected, $attrs, $tpl); }
public function testLast() { $test = array('a' => array('a', 'b', 'c')); is('c', Arr::last(Vars::get($test['a']))); }