Created
October 16, 2013 11:55
-
-
Save cebe/7006561 to your computer and use it in GitHub Desktop.
Autoloading namespaced model in yii 1.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected/controllers/EmailController.php | |
<?php | |
// no namespace needed here | |
class EmailController extends controller{ | |
public function actionSend(){ | |
$recipient = new \application\documents\email\Recipient(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected/documents/email/Recipient.php | |
<?php | |
namespace application\documents\email; | |
class Recipient extends EMongoDocument{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can make action code look nicer by doing this in controller: