@@ -49,26 +49,32 @@ public function __construct (\Cake\View\View $view, array $config = []) {
4949 * @param $icon Name of the icon.
5050 *
5151 **/
52- public function icon ($ icon ) {
53- return $ this ->_useFontAwesome ? $ this ->faIcon ($ icon ) : $ this ->glIcon ($ icon );
52+ public function icon ($ icon, $ options = array () ) {
53+ return $ this ->_useFontAwesome ? $ this ->faIcon ($ icon, $ options ) : $ this ->glIcon ($ icon, $ options );
5454 }
5555
5656 /**
5757 * Create a font awesome icon.
5858 *
5959 * @param $icon Name of the icon.
6060 */
61- public function faIcon ($ icon ) {
62- return '<i class="fa fa- ' .$ icon .'"></i> ' ;
61+ public function faIcon ($ icon , $ options = array ()) {
62+ $ options = $ this ->addClass ($ options , 'fa ' );
63+ $ options = $ this ->addClass ($ options , 'fa- ' .$ icon );
64+
65+ return $ this ->tag ('i ' , '' , $ options );
6366 }
6467
6568 /**
6669 * Create a glyphicon icon.
6770 *
6871 * @param $icon Name of the icon.
6972 */
70- public function glIcon ($ icon ) {
71- return '<i class="glyphicon glyphicon- ' .$ icon .'"></i> ' ;
73+ public function glIcon ($ icon , $ options = array ()) {
74+ $ options = $ this ->addClass ($ options , 'glyphicon ' );
75+ $ options = $ this ->addClass ($ options , 'glyphicon- ' .$ icon );
76+
77+ return $ this ->tag ('i ' , '' , $ options );
7278 }
7379
7480 /**
0 commit comments