02-01-2009, 12:25 PM
[eluser]bagwaa[/eluser]
Greetings All,
I am quite new to CI but have been using PHP for many years, I decided to learn CI because I wanted a decent framework and all the others I just didn't quite like enough. I have also been using Ruby on Rails which I do like, but my main forte is PHP so CI is perfect.
As I am new to MVC frameworks my question is regarding views, I have created an application recently for a client who wants an online store to deliver PDFs, simple enough and with CI its actually fun to-do! but one thing that I wasn't comfortable with was my views. Now this may well be either me doing it wrong, or trying to stick to the MVC concept to much, but I had a set of data which I wanted to draw out on a page which sits in a table. The code I wrote basically creates the table and then has a foreach loop embedded into the html so that the data can be placed within <td></td> tags, I then use the % operator so that every 4 items, it starts a new row <tr></tr>.
Using foreach loops in a view seems like a really crude way of doing it in CI, is there a way to build these tables up or am I just thinking about the MVC structure too much?
Thanks,
Richard
Greetings All,
I am quite new to CI but have been using PHP for many years, I decided to learn CI because I wanted a decent framework and all the others I just didn't quite like enough. I have also been using Ruby on Rails which I do like, but my main forte is PHP so CI is perfect.
As I am new to MVC frameworks my question is regarding views, I have created an application recently for a client who wants an online store to deliver PDFs, simple enough and with CI its actually fun to-do! but one thing that I wasn't comfortable with was my views. Now this may well be either me doing it wrong, or trying to stick to the MVC concept to much, but I had a set of data which I wanted to draw out on a page which sits in a table. The code I wrote basically creates the table and then has a foreach loop embedded into the html so that the data can be placed within <td></td> tags, I then use the % operator so that every 4 items, it starts a new row <tr></tr>.
Using foreach loops in a view seems like a really crude way of doing it in CI, is there a way to build these tables up or am I just thinking about the MVC structure too much?
Thanks,
Richard