![]() |
Icon font helper (under construction) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Icon font helper (under construction) (/showthread.php?tid=54373) |
Icon font helper (under construction) - El Forum - 09-06-2012 [eluser]Unknown[/eluser] I'm very new to CodeIgniter and I'm trying to get a hang of it. Recently I discovered icon fonts, which would come in handy since I'm not a graphics geek myself and I dislike real images on websites. This morning I started writing an icon font helper for use in controllers. My reason for this is that in the future I maybe would like to switch my preferred icon font, but I don't want to change hundreds of hardcoded characters in all my views. The current layout of my icon font helper is the following: Code: <?php It is far from complete, but I'm using it like this in my controller: Code: <?php And then in my view: Code: <?php foreach ($blog_posts as $blog_post): ?> The CSS class "icon" is set to use the @font-face rule for the chosen font, Entypo. Is this whole thing stupid? Am I stupid? (You may correct me on some other code errors as I'm quite new to CodeIgniter.) |