<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Md Emran Hasan (phpfour) - Latest Comments in Extended Model for CodeIgniter</title><link>http://phpfour.disqus.com/</link><description>This is Emran Hasan's blog for PHP, CSS, XHTML, JavaScript, Web 2.0, AJAX, Usability, and Web Standards related views, ideas, and sharing.</description><language>en</language><lastBuildDate>Tue, 10 Feb 2009 14:04:55 -0000</lastBuildDate><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-6144170</link><description>Thanks a lot~~&lt;br&gt;your extension save me lot of time! :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">u3nu3n</dc:creator><pubDate>Tue, 10 Feb 2009 14:04:55 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-6088566</link><description>Thanks Emran for this blog.Though Iam not a guru like some of you here,but i like the framework.&lt;br&gt;Iam a newbie to CI.Thanks again.&lt;br&gt;&lt;br&gt;Abbas</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Abbas Mandal</dc:creator><pubDate>Sun, 08 Feb 2009 02:04:02 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-5684790</link><description>The only way I could get this to work in Code Igniter 1.7.0 was to replace the Model.php in the system/libraries directory as the above methods didn't work for me.&lt;br&gt;&lt;br&gt;This could be because I'm using Matchbox 0.9.4 which hasn't been updated to include a lot of the new code in Loader.php yet...&lt;br&gt;&lt;br&gt;But apart from that, this is such a time saver and a brilliant piece of kit to add to your Code Igniter arsenal.&lt;br&gt;&lt;br&gt;Thanks heaps for creating it and looking forward to seeing the additional features you've got planned.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan Blunden</dc:creator><pubDate>Fri, 30 Jan 2009 07:46:12 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-5267546</link><description>Emran and others,&lt;br&gt;Thanks for the innovative work Emran. The comments also proved extremely helpful.&lt;br&gt;&lt;br&gt;@Michael Wales: Extremely helpful and encouraging as always (esp. in the CI forums).&lt;br&gt;&lt;br&gt;@Jacob &amp; @stensi: Thanks for the additions.&lt;br&gt;&lt;br&gt;@ryan &amp; @joshdavey &amp; @abe: Good call all around. To come on someone's forum and sound so arrogant shows a lack of taste, respect and manners.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Software_Miami</dc:creator><pubDate>Sun, 18 Jan 2009 12:52:09 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-5047317</link><description>Why not using HMVC &amp; Ignited Record &amp; write a page module (like haughin' did) instead of hacking the core?&lt;br&gt;Saves even more time ^^</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Carlos</dc:creator><pubDate>Sat, 10 Jan 2009 15:32:25 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-4663535</link><description>Forgive the personality analysis, but your seemingly irate attitude towards the author necessitated commentary.&lt;br&gt;&lt;br&gt;Do bear in mind that you're a guest on this website, not an unpaid asshole.&lt;br&gt;&lt;br&gt;Your message is true, but your delivery is definitely flawed. I'd recommend trying to be a little more polite, or you'll keep getting comments from people like Ryan. While I agree with what you said, the way you came across was pretty overwhelmingly full of douchebaggery. I have not personally visited the CakePHP forums but if they're full of people such as yourself who display a genuine "inability" to be polite, I don't plan on visiting anytime soon.&lt;br&gt;&lt;br&gt;It is rather apparent that you're a CakePHP fan, but don't turn it into some form of irrational zeal. Step one would be to resist all caps. Step two would be to assume that other people aren't as brilliant as you, and don't have the MIT license memorised. Step three would be to perhaps quietly suggest that the author credit the source that shows definite similarity to his code snippets, instead of full-force attacking him.&lt;br&gt;&lt;br&gt;Thanks for the info, Emran. I was trying to extend Model.php, and I eventually just popped a customised copy of "Model.php" in my APPPATH/libraries folder and overrode the default Model file altogether.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Abe</dc:creator><pubDate>Sat, 27 Dec 2008 04:26:27 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-3328727</link><description>Thanks Jacob for pointing this out !!! I've been waiting for long to have CI support this. I will write a separate post with the update and a few additional features I planned long ago (probably post date: first week of Nov).&lt;br&gt;&lt;br&gt;Everybody, please follow Jacob's two comments if you're using CodeIgniter 1.7.0.&lt;br&gt;&lt;br&gt;Cheers!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">phpfour</dc:creator><pubDate>Mon, 27 Oct 2008 14:49:33 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-3321831</link><description>Thanks for the reply, Emran! I hadn't seen your reply when I posted my fix below.&lt;br&gt;&lt;br&gt;What I've done (in addition to the fix below) is rename it to MY_Model.php, placed it in system/application/libraries, updated the constructor to class MY_Model extends Model, and that's literally it. It's all working so far - I'll post back if I hit another snag :)&lt;br&gt;&lt;br&gt;It may well be something they've fixed in these latest updates to CI, so you may wish to try it again, and if it works for, update your instructions accordingly.&lt;br&gt;&lt;br&gt;Thanks for your contribution - it looks like it will be very useful!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacob</dc:creator><pubDate>Mon, 27 Oct 2008 05:11:18 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-3319092</link><description>Well, as always after posting a 'help me!' question, I've worked it out.&lt;br&gt;&lt;br&gt;Replace Line 196 of MY_Model.php:&lt;br&gt;&lt;br&gt;$this-&amp;gt;fields = $this-&amp;gt;db-&amp;gt;field_names($table);&lt;br&gt;&lt;br&gt;with&lt;br&gt;&lt;br&gt;$this-&amp;gt;fields = $this-&amp;gt;db-&amp;gt;list_fields($table);&lt;br&gt;&lt;br&gt;as field_names() is deprecated, and clearly in 1.7.0 does not work!!&lt;br&gt;&lt;br&gt;Hope this helps someone else :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacob</dc:creator><pubDate>Sun, 26 Oct 2008 23:30:36 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-3319015</link><description>Michael's suggestion actually doesn't work, as I mentioned in my reply to him. You'll have to replace the actual Model.php in system/libraries to make it work. Hope this helps.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">phpfour</dc:creator><pubDate>Sun, 26 Oct 2008 23:23:27 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-3317903</link><description>I'd like to try using this, and I've tried it using Michael's suggestion, eg renaming to MY_Model etc, but I keep getting this error:&lt;br&gt;&lt;br&gt;Fatal error: Call to undefined method CI_DB_mysql_driver::field_names() in C:\home\codeigniter\system\application\libraries\MY_Model.php on line 196&lt;br&gt;&lt;br&gt;and I just can't work out how to get around it... any help would be great!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacob</dc:creator><pubDate>Sun, 26 Oct 2008 23:02:19 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839049</link><description>Great work. It saves us a lot of time.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">haran</dc:creator><pubDate>Wed, 20 Aug 2008 11:20:10 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839058</link><description>@joshdavey: why do a lot of people INSIST ON NOT READING before posting? Check the previous messages, this was SOLVED long ago.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mariano Iglesias</dc:creator><pubDate>Mon, 18 Aug 2008 15:40:02 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839059</link><description>@Mariano Iglesias&lt;br&gt;&lt;br&gt;You really want him to re-name "query(), "getNumRows()", "$this-&amp;gt;data" and other method/property names? These are standard method names used by pretty much every database abstraction layer in the history of programming. &lt;br&gt;&lt;br&gt;Saying phpfour isn't respecting the MIT license is a bit harsh. He's just looking at other libraries for inspiration and building his own. Nothing wrong with that.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">joshdavey</dc:creator><pubDate>Mon, 18 Aug 2008 15:00:29 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839070</link><description>@Ryan: I fully agree with Mariano and would misjudge the CI community in the same way, seeing your response. &lt;br&gt;&lt;br&gt;What Mariano did was just to remind me something that I forgot, although in a bit rough way, but he had no bad intention in mind and I thanked him for that.&lt;br&gt;&lt;br&gt;We're all community enthusiastic, let's not create divisions and point fingers.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">phpfour</dc:creator><pubDate>Fri, 08 Aug 2008 09:34:23 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839071</link><description>Having been (and currently beeing) on several open source projects I know this is not unheard of. But people like Ryan on his comment above (showing that his brain consists only of derogative terms) certainly do not help the projects.&lt;br&gt;&lt;br&gt;For the sake of CI, I hope you have more of the "other kind" of people. You know, people that KNOW something about something, and HELP the project back, for a change.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mariano Iglesias</dc:creator><pubDate>Fri, 08 Aug 2008 09:13:55 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839067</link><description>@Mariano Douchebag Boy&lt;br&gt;&lt;br&gt;Go away you miserable creature.  Take your nastiness to a cake forum.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan</dc:creator><pubDate>Sat, 02 Aug 2008 21:39:03 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839052</link><description>Although after testing, that doesn't work o.O&lt;br&gt;&lt;br&gt;Leaving out the CI_ and putting it in application/libraries allows it to run perfectly fine.&lt;br&gt;&lt;br&gt;I wonder why CodeIgniter doesn't allow the CI_ override for the Model?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">stensi</dc:creator><pubDate>Tue, 22 Jul 2008 22:22:49 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839051</link><description>As PHPFour's model is not an extension but a replacement, here's how I would set it up.&lt;br&gt;&lt;br&gt;Open PHPFour's 'Model.php' and do the following to it:&lt;br&gt;&lt;br&gt;&lt;br&gt;Change:&lt;br&gt;&lt;br&gt;class Model {&lt;br&gt;&lt;br&gt;To:&lt;br&gt;&lt;br&gt;class CI_Model {&lt;br&gt;&lt;br&gt;&lt;br&gt;Change:&lt;br&gt;&lt;br&gt;	function Model()&lt;br&gt;&lt;br&gt;To:&lt;br&gt;&lt;br&gt;	function CI_Model()&lt;br&gt;&lt;br&gt;&lt;br&gt;Save the file as 'Model.php' and place it in:&lt;br&gt;&lt;br&gt;application/libraries&lt;br&gt;&lt;br&gt;&lt;br&gt;This is the proper way to replace core libraries. Source:&lt;br&gt;&lt;a href="http://codeigniter.com/user_guide/general/core_classes.html" rel="nofollow"&gt;http://codeigniter.com/user_guide/general/core_...&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">stensi</dc:creator><pubDate>Tue, 22 Jul 2008 22:00:54 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839054</link><description>@Emran&lt;br&gt;&lt;br&gt;Great work, Thats what I am saying since you've showed me the code last year sometime. But unfortunately I have left using CI. &lt;br&gt;&lt;br&gt;@Mariano&lt;br&gt;Thanks for pointing out that method names were borrowed from CakePHP, but that clearly didnt disrespect MIT license model. It is not a derived work but written from scratch, did you note that? I appreciate your observation but I still think you were a bit rough at this one. Anyway, thanks. No hard feelings.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Storyteller</dc:creator><pubDate>Mon, 21 Jul 2008 02:51:52 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839056</link><description>@taewoo: before you post, READ. That works on every level. He DID say he FORGOT to credit CakePHP until I reminded him, so you should double read the comments before you call me anal.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mariano Iglesias</dc:creator><pubDate>Sat, 19 Jul 2008 10:54:56 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839057</link><description>Good one.&lt;br&gt;&lt;br&gt;@mariano - Damn dude. Relax. He did thank CakePHP for their inspiration. NO need to be so anal.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">taewoo</dc:creator><pubDate>Fri, 18 Jul 2008 14:47:58 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839053</link><description>Nice one there. Thanks for posting it. Small, but nice addition to CI. ;)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pengekcs</dc:creator><pubDate>Tue, 15 Jul 2008 14:51:00 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839065</link><description>@Mariano&lt;br&gt;&lt;br&gt;Thank you very much for reminding me the source. It is my bad that I completely forgot to mention the credit to CakePHP's model implementation. &lt;br&gt;&lt;br&gt;I actually created this in the middle of last year and have been using from then. The day I posted it here, I was actually rushing - so the due credit was missing. I'm going to update the post with a mention to this.&lt;br&gt;&lt;br&gt;And btw, I've only taken inspiration for the methods and variable names. The code utilizes the Active Record library of CodeIgniter. Also, it doesn't burden the developer with the associations.&lt;br&gt;&lt;br&gt;Thanks a lot.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">phpfour</dc:creator><pubDate>Mon, 14 Jul 2008 16:28:36 -0000</pubDate></item><item><title>Re: Extended Model for CodeIgniter</title><link>http://www.phpfour.com/blog/2008/07/12/extended-model-for-codeigniter/#comment-2839064</link><description>@Wales,&lt;br&gt;&lt;br&gt;Thanks for the appreciation. I actually tried not to hack into the core but the overloading of base CI classes didn't work with the Model class. &lt;br&gt;&lt;br&gt;If you can get it working in any way, I'd be more than happy to follow that and update the install steps accordingly.&lt;br&gt;&lt;br&gt;Thanks a lot.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">phpfour</dc:creator><pubDate>Mon, 14 Jul 2008 16:23:25 -0000</pubDate></item></channel></rss>