Welcome Guest, Not a member yet? Register   Sign In
Global Includes
#1

[eluser]Last Pariah[/eluser]
Normally when I am developing I create a utilities.php file which includes global functions like checking if a user is logged in or if they are authorized to edit a page. I am use to just putting an include at the top of every page.

Is there a better way of doing this with CI? or do I have to just go back to my usual way of putting an includes at the top of every page? I am new to CI, the coding model and RAD so I am sort of a newbie.

I know there is probably a really simple answer to this or I am over thinking it. Any help would be appreciated.
#2

[eluser]Last Pariah[/eluser]
Could use
php_value auto_prepend_file /full/path/to/script.php
in htaccess I suppose

Any other ideas?
#3

[eluser]Last Pariah[/eluser]
NM I got it, I am new to oop as well. Sorry for the posts Id delete them if I could heh.
#4

[eluser]tonanbarbarian[/eluser]
helpers are what you are looking for
create helper functions that can include what you want
they can even load other views to display the extra parts
Helpers




Theme © iAndrew 2016 - Forum software by © MyBB