tylersmith102998 / GekPHP

An open-source framework for prototyping your projects
1 stars 0 forks source link

Implement models to plugins + other littler changes. #7

Closed tylersmith102998 closed 4 years ago

tylersmith102998 commented 4 years ago

Plugins now implement their own models, to be stored in \Plugins\\Models. ALL MODELS BELONGING TO A PLUGIN MUST USE NAMESPACE \Plugins\\Models. (#3)

Added .htaccess to handle redirects to index, as it was missing before.

Added comment to line 62 of src\Core\App.php. Next line also catches FileNotFoundException when it doesn't seem to be neccessary.

Changed how src\Core\BaseModel::__construct() parses table name. Now uses explode() and array_pop() rather than trying to remove specific bits. Allows other namespaces to be used for Models.

src\core\DB::174 is a comment for debugging SQL code. Just remove the comment characters to preview the SQL next pageload.

src\Core\Models.php::31-55 is required for the plugin-specific models to work correctly. Updated other bits of the code accordingly. Lines 86-90 help to parse if the Models class was instantiated from a plugin.

Removed www\Models\UsersModel.php - Please remove generated DB table that was made by this model. Was only there for testing purposes.