Mindia_Form_Element_FastSelectの履歴
Zend_Form_Element_selectが何故か翻訳のところで時間食ってるので、翻訳機能を完全に取り除いたやつを作ってみた。特に項目数が多いところで威力大。50%ぐらいは早くなったかも!?
<?php /** * 翻訳機能をoffにして速度向上 * * @copyright Mindia Inc. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Mindia_Form_Element_FastSelect extends Zend_Form_Element_Multi { /** * Use formSelect view helper by default * @var string */ public $helper = 'formSelect'; /** * Add an option * * @param string $option * @param string $value * @return Zend_Form_Element_Multi */ public function addMultiOption($option, $value = '') { $option = (string) $option; $this->_getMultiOptions(); $this->options[$option] = $value; return $this; } /** * Retrieve single multi option * * @param string $option * @return mixed */ public function getMultiOption($option) { $option = (string) $option; $this->_getMultiOptions(); if (isset($this->options[$option])) { return $this->options[$option]; } return null; } /** * Retrieve options * * @return array */ public function getMultiOptions() { $this->_getMultiOptions(); return $this->options; } /** * Remove a single multi option * * @param string $option * @return bool */ public function removeMultiOption($option) { $option = (string) $option; $this->_getMultiOptions(); if (isset($this->options[$option])) { unset($this->options[$option]); return true; } return false; } /** * Clear all options * * @return Zend_Form_Element_Multi */ public function clearMultiOptions() { $this->options = array(); return $this; } }