![]() |
NONSENSE in html helper... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: NONSENSE in html helper... (/showthread.php?tid=21838) |
NONSENSE in html helper... - El Forum - 08-22-2009 [eluser]walrus_lt[/eluser] Hi. I found nonsense in ci/html_helper and i hate it because it wastes cpu... Just look at this...: Code: if ( ! function_exists('img')) Now look closer: Code: foreach ($src as $k=>$v) $CI =& get_instance(); in loop? Wtf.. NONSENSE in html helper... - El Forum - 08-22-2009 [eluser]wiredesignz[/eluser] Post some feedback in the bug forum and maybe the Ellislab geeks will overhaul the code. Although I have to admit I do see worse code posted these forums quite regularly. ![]() NONSENSE in html helper... - El Forum - 08-22-2009 [eluser]Pascal Kriete[/eluser] It only runs for the src attribute. In other words - once per function call (unless your image tag has two src's...). In fact, not even on every function call, only if the src attribute is not a full url. I'm having a hard time optimizing it further, but I'm willing to consider alternatives. NONSENSE in html helper... - El Forum - 08-22-2009 [eluser]wiredesignz[/eluser] Using the img function in the html helper would generally suggest people will be using a relative url rather than a full url. (local assets et al) But you're right it's pretty trivial. Even if it is really terrible code. |