Created
August 20, 2011 10:37
-
-
Save julesbou/1158943 to your computer and use it in GitHub Desktop.
For the love of god don't do this!
This file contains 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
<?php | |
foreach ($this->models as $model) { | |
$_file = '../' . $this->app . 'Models/' . $model . 'Model.php'; | |
$_class = $model . 'Model'; | |
if (file_exists($_file)) { | |
require_once $_file; | |
$this->{ucfirst($model)} = new $_class(null, dbConfig::$default); | |
} else { | |
$class = 'class ' . $_class . ' extends Model { }'; | |
eval($class); | |
$this->{ucfirst($model)} = new $_class(null, dbConfig::$default); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You know that instead of creating a new gist when you want to change something, you can just edit the one you have? The gist will be versioned.