How To Become Sum Url Amongst Enquiry Strings Inwards Codeigniter?
If you lot purpose current_url(), it volition provide the amount URL (including segments) of the page beingness currently viewed.But if your URL contains inquiry string or parameters, it won't include those inquiry strings inwards the amount URL.
For example, if your URL was this:
You tin dismiss alter the Codeigniter's heart URL helper or extend the URL helper to your needs. I prefer to add together novel business office for this keeping the native business office equally it is.
Create a MY_url_helper.php within 'application/helpers' folder.
For example, if your URL was this:
http://example.com/blog?q=test&name=facebookThe business office would return:
http://example.com/blog //The url without the inquiry strings.Solution:
You tin dismiss alter the Codeigniter's heart URL helper or extend the URL helper to your needs. I prefer to add together novel business office for this keeping the native business office equally it is.
Create a MY_url_helper.php within 'application/helpers' folder.
<?php if ( ! defined('BASEPATH')) exit('No straight script access allowed'); business office current_full_url() { $CI =& get_instance(); $url = $CI->config->site_url($CI->uri->uri_string()); provide $_SERVER['QUERY_STRING'] ? $url.'?'.$_SERVER['QUERY_STRING'] : $url; } /* End of file MY_url_helper.php */ /* Location: ./application/helpers/MY_url_helper.php */Now you lot tin dismiss purpose current_full_url() to stance Full URL amongst inquiry strings. The business office would return:
http://example.com/blog?q=test&name=facebookSumber http://developer-paradize.blogspot.com
Comments
Post a Comment