Views and PHP Code

#1
[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


Messages In This Thread
Views and PHP Code - by El Forum - 02-01-2009, 12:25 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:03 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:54 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:57 PM
Views and PHP Code - by El Forum - 02-01-2009, 02:11 PM
Views and PHP Code - by El Forum - 02-01-2009, 07:36 PM
Views and PHP Code - by El Forum - 02-01-2009, 07:48 PM
Views and PHP Code - by El Forum - 02-01-2009, 08:49 PM
Views and PHP Code - by El Forum - 02-01-2009, 09:00 PM
Views and PHP Code - by El Forum - 02-01-2009, 10:15 PM
Views and PHP Code - by El Forum - 02-01-2009, 10:32 PM
Views and PHP Code - by El Forum - 02-01-2009, 11:20 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.