MY MY_url_helper.php File! - 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: MY MY_url_helper.php File! (/showthread.php?tid=58572) |
MY MY_url_helper.php File! - El Forum - 06-25-2013 [eluser]SpYk3[/eluser] This has been ubberly useful to me for years, so I figured I'd share. Keep in mind this Extension is based on setting folders like `js` to the main directory. It provides methods like: js_url('somefile.js'); - get path of JavaScript Directory. Pass in file name or dir/file to get a complete file path. css_url('somefile.css'); - get path of Style Sheet Directory and files images_url('someimage.png') - Same as previously mentioned Also included are some useful methods, not really url related, but i just always squeeze in this file. Not any real reason for a whole nother file just for 1 simple method. preDump(params); - Just like var_dump, except it add `PRE` tags around what it dumps to view. gives a much nicer and cleaner view. Lastly included are a couple simple functions for getting URL Parameters and Dumping them to view. urlParams(); - Get's array of url parameters, like $this->input->get(), except it checks both GET and POST urlParamsDump(); - Uses preDump function to show urlParams Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); MY MY_url_helper.php File! - El Forum - 06-25-2013 [eluser]jairoh_[/eluser] We appreciate your contribution sir. MY MY_url_helper.php File! - El Forum - 07-17-2013 [eluser]quickshiftin[/eluser] Very nice! |