[eluser]Bleeding Edge Productions[/eluser]
Hi guys,
What is the best way to make URLs portable in case of a page location changing and needing to update all the links on a site.
The URL helper looks like the one:
Would it be good practice to set up variables in the index.php (or the default controller), like:
Code:
$url_home = 'index.php';
$url_contact = 'contact/';
$url_blog = 'personal/blog/';
$url_calendar = 'personal/calendar/main.php';
Etc. And then throughout the site when I need to create a link, I just use
Code:
<?php echo site_url($url_contact); ?>
to dynamically create the link.
Is this the most appropriate way (i.e. best practice) to go about it, or is there a better method?
Many thanks,
Martin