|
<?php
// system/application/controllers/hello.php
class Hello extends Controller {
function world() {
echo "Hello CodeIgniter!";
}
function user_test() {
$u = new User;
$u->username = 'johndoe';
$u->password = 'secret';
$u->first_name = 'John';
$u->last_name = 'Doe';
$u->save();
$u2 = new User;
$u2->username = 'phprocks';
$u2->password = 'mypass';
$u2->first_name = 'Codeigniter';
$u2->last_name = 'Doctrine';
$u2->save();
echo "added 2 users";
}
}
这里好像有点问题测试出现错误 麻烦解决一下 原文没有最后面这个,我把英文中的这段代码用上也有一点问题测试不成功 麻烦解决一下 |
|