/** * Helper function to create a new Text Button with optional handler, name, id and icon. * If $iconUrl is set it asigns the corresponding CssClass 'x-btn-text-icon' to show icon and text. * * @param string $text * @param PhpExt_Handler $handler * @param string $name * @param string $id * @param string $icon * @return PhpExt_Button */ public static function createTextButton($text, $handler = null, $name = null, $id = null, $icon = null) { $btn = new PhpExt_Button(); $btn->setText($text); if ($handler !== null) { $btn->setHandler($handler); } if ($name !== null) { $btn->setName($name); } if ($id !== null) { $btn->setId($id); } if ($icon !== NULL) { $btn->setIcon($icon); $btn->setCssClass("x-btn-text-icon"); } return $btn; }