Welcome Guest, Not a member yet? Register   Sign In
Organising View files with YUI
#1

[eluser]iainco[/eluser]
Hey guys, new to CI and using it for the first time with a project, going well so far!

I was just wondering, for those of you who use YUI how you go about organising your view files.

I ended up having loads of different views like header, login (with just a login form), registration (another form) and so on.

But the problem arises when I want to use different layouts for different pages... I think the only solution is to have a header and footer view (which is always going to be the same for every page), then have a more complete view (not just a form) for each of the different layouts I wish to use.

Would appreciate any advice available but I've probably not explained my problem that well!

Thanks,

Iain
#2

[eluser]Colin Williams[/eluser]
I don't see where YUI has come in, as it's a client-side JavaScript framework, but you sound like you're on the right track:

Quote:I think the only solution is to have a header and footer view (which is always going to be the same for every page), then have a more complete view (not just a form) for each of the different layouts I wish to use.

Although I would have one main template view, with the static header and footer in place and a $content variable to pass in your other layouts. Check my sig for a Library that facilitates this. Vanilla CI views will most likely take you far enough though, it appears.
#3

[eluser]Unknown[/eluser]
I use YUI Grids CSS to do all my page formatting as well. (love it!) and have separate headers and footers and just do whatever in between as you mentioned.

Hardly notice the two calls in the controller to bring in the views anymore as all my concentration goes straight towards the main layout view. To the point where I have my standard starting templates set so when I need a new page controller I can immediately dig into the main content of the pages.

I did spend some time looking at the Template Library but I am too far into the project right now to change my pattern. Once I get cranking it is hard to stop and refactor but I will look closer at it for the next one!
#4

[eluser]Colin Williams[/eluser]
Quote:YUI Grids CSS

Oh. Disregard my YUI remark. Forgot they were in the "CSS Framework" game.




Theme © iAndrew 2016 - Forum software by © MyBB