DooPHP IRC channel


Loading Models

Share your tips, snippets and experiences about DooPHP, and discuss about best DooPHP practices.

Loading Models

Postby leng » Mon Aug 10, 2009 3:44 pm

Just a simple tips on the loading models:

In case that you didn't notice, the model class is loaded automatically when using with DooSqlMagic db object (since the initial 1.0).
Code: Select all
//You do not have to load User.php
Doo::db()->find('User');


However, you would need to load the Model if you're doing this:
Code: Select all
Doo::loadModel('User');
$user = new User;
$user->name = 'Leng';
Doo::db()->find($user);
Just Doo IT!
leng
 
Posts: 1482
Joined: Thu Jul 16, 2009 11:33 pm

Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron