Trying to use MVC - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Trying to use MVC (/showthread.php?tid=13029) |
Trying to use MVC - El Forum - 11-07-2008 [eluser]d4v0[/eluser] Hi everybody! I've been trying to work with with the MVC using CI, but i have some problems! :red: I'm just a beginner! ... But I want to learn more than CI! Well, this is my model: 'mimodelo.php' Code: <?PHP As you see, my table's name is ALL_M_RUB. This is my controller: 'micontrol.php' :cheese: Code: <?PHP And finally, this is my view ... but it's incomplete... 'mivista.php' :roll: Code: <?PHP That's my poblem..! :-S ... I don't know how to catch the results and show them all! The fields of my table are 3: 'RUB_ORD' , 'RUB_DES' and 'RUB_STATUS'. What is missing... or what am i doing bad?? Help! ... =( Thanks! Trying to use MVC - El Forum - 11-07-2008 [eluser]John_Betong[/eluser] Quote: Take a look at your results by using this code: Code: // in your Mimodelo Once you see what the results of print_r(...) then you will be able to format your array data. Trying to use MVC - El Forum - 11-07-2008 [eluser]d4v0[/eluser] hey man!... do u have an e-mail... because... it doesn't work... i need an example where a controller get data from a model... and then show it in a view. But this data is a query with more than one column... you got it?? I've been searching examples... but... i can't find what i want...! =( Trying to use MVC - El Forum - 11-08-2008 [eluser]John_Betong[/eluser] [quote author="d4v0" date="1226143716"]hey man!... do u have an e-mail... because... it doesn't work... i need an example where a controller get data from a model... and then show it in a view. But this data is a query with more than one column... you got it?? I've been searching examples... but... i can't find what i want...! =([/quote] Here you go I have just uploaded a new page to my website showing the last 42 jokes: My Model Library Code: //============================================= My Controller Code: //============================================= My View Code: <html> See it in action here: http://johns-jokes.com/joke/last_42 Trying to use MVC - El Forum - 11-08-2008 [eluser]d4v0[/eluser] Hey man!... Thanks a lot! ... I know how to do it now!... Trying to use MVC - El Forum - 11-08-2008 [eluser]John_Betong[/eluser] [quote author="d4v0" date="1226213399"]Hey man!... Thanks a lot! ... I know how to do it now!...[/quote] Your welcome, I am pleased to be able to help and looking forward to seeing your new site. Trying to use MVC - El Forum - 12-10-2008 [eluser]Unknown[/eluser] I am a good procedural dude, but new to oop. This was a better example than the user guide. Thanks, The Maestro Trying to use MVC - El Forum - 12-11-2008 [eluser]John_Betong[/eluser] [quote author="Maestrog" date="1228940367"]I am a good procedural dude, but new to oop. This was a better example than the user guide. Thanks, The Maestro[/quote] I am pleased I was able to help. I find the user guide very good but a bit too cryptic for me. I would like to see more examples since a good working example is far more useful in trying to understand a new topic. Vague memories this topic has been previously raised and answered at length. |