Welcome Guest, Not a member yet? Register   Sign In
Best practice for simple HTML and PHP code reuse in views?
#1

[eluser]mazaka[/eluser]
Hi all, I just started using CI, and it looks very promising!

I searched the forum for good ways of reusing and including code in views, but havent found exactly what I am looking for.

I simply want to include pageheaders, footers, simple nav bars and CSS info (yeah I have to have it inline, I cant link it to external css files for this proj. Its for phones. Phones dont like that.)


Until I find a better way, I do this in a VIEW file:

Code:
<head>
        <?php require dirname(__FILE__).'/../myOwnIncludeFolder/inc.css.xhtml.php'; ?>
</head>

Does someone have the correct approach?

thanks!
#2

[eluser]sophistry[/eluser]
The FAQ will lead you in several directions - one of them will satisfy.
#3

[eluser]mazaka[/eluser]
Ah, you're right, I found a good answer there!
Thanks for a fast response!




Theme © iAndrew 2016 - Forum software by © MyBB