Welcome Guest, Not a member yet? Register   Sign In
How to avoid using <?=base_url();?> in link href?
#4

[eluser]mcr_rm[/eluser]
Depends how you have your application set up. Personally I use Base url methods in my header include files as I pass all views through a template which includes the header and footer or individual calls to load the header and footer view files in other views. I then have at max around five base_url calls to include sme scripts.

The rest of the things you reference could be cleared up by using CI form helper to open your forms (automatically includes the correct path) and url anchor method for links etc.

http://ellislab.com/codeigniter/user-gui...elper.html
http://ellislab.com/codeigniter/user-gui...elper.html


If you are not using standard header includes etc for views then that is perhaps something to look at.

The method above with the single slash is the absolute path as mentioned by Rick and this is not helpful should you reuse your appication in a sub directory or need to scale in any way.


Messages In This Thread
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 10:13 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 10:40 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 11:53 AM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 12:22 PM
How to avoid using <?=base_url();?> in link href? - by El Forum - 01-07-2010, 12:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB