Welcome Guest, Not a member yet? Register   Sign In
organization of files
#1

[eluser]dadamssg[/eluser]
I'm trying to set this up as 'best practice' as i can.

I have my controllers and view files that are working but i want to have a file in which i include in all of my views. In this include file i want to hold a function that will just echo my header.

This way i can just type the header code once(in the include file) and then include it in all of my views and then just call my function that echos out my header.

My question is..where should i put this include file? Is it a model? or do i put in my view folder because it is something i will be viewing?
#2

[eluser]dadamssg[/eluser]
Also, i have a function that creates a snippet from text. Where should this function go?
#3

[eluser]theprodigy[/eluser]
Why don't you just create a 'header' view?

You can read about it in the user guide here

There is a section called "Loading multiple views".

As for your functions, if they wouldn't fall nicely into a class, and are left to themselves, then the best place for them would be in a helper. If they would fall nicely into a class, then a library would be your best bet.




Theme © iAndrew 2016 - Forum software by © MyBB