Skip to content

Instantly share code, notes, and snippets.

@julesbou
Created August 20, 2011 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julesbou/1158943 to your computer and use it in GitHub Desktop.
Save julesbou/1158943 to your computer and use it in GitHub Desktop.
For the love of god don't do this!
<?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);
}
}
@md2perpe
Copy link

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.

@julesbou
Copy link
Author

form was double submited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment