/** * Helper function to create a Toolbar Button * If $iconUrl is set it asigns the corresponding CssClass 'x-btn-text-icon' to show icon and text. * * @param string $text * @param string $iconUrl * @param PhpExt_Handler $handler * @return PhpExt_Toolbar_Button */ public static function createButton($text, $iconUrl = null, $handler = null) { $btn = new PhpExt_Toolbar_Button(); $btn->setText($text); if ($iconUrl !== null) { $btn->setIcon($iconUrl); if ($btn->getCssClass() == null) { $btn->setCssClass("x-btn-text-icon"); } } if ($handler !== null) { $btn->setHandler($handler); } return $btn; }