Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FIRST, the error "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in ....." is caused by parent::__construct()
- I do parent::__construct() because I want the Controllers to have access to the Models, and with parent::__construct() you could do that, without doing
- something like global $myController;, I guess you could also do myController::function, but I don't know.
- Another thing that could be done is not load the classes on __construct(), but do some functions in the Bootstrap suchas as loadModel(), which would load
- the Model class and all the Models, and use that function when we need to use the model(always in controller)
- Example of that:
- Class U_Controlller
- {
- public function login()
- {
- $model = $this->loadModel() //Comes from the bootstrap
- if($model->U_Model->nameTaken($_POST['lusername']) == false)
- {
- echo 'Name is not taken!';
- }
- else
- {
- echo 'Name is taken!';
- }
- }
- }
- Second, I am planning of calling the controller in the template files(.html) like {U_Controller-login}, by making each controller and its function a
- template parameter, I do this in Controller.php, only problem is that when I set them as a param it calls the function, instead of calling it when the param
- is read. Gotta' find a work-around to this.
- Third, I am planning on doing something like, instead of $_POST['lusername'], do something like $Application->Controller->View->F_View->set();, which would
- make filtered($_POST['lusername']) into $Application->Controller->View->F_View->lusername; that's something I did for RevCMS.
- Fourth, I am using an abstract database layer to handle which engine the CMS is using, I'm planning on implementing SQLite(maybe SQLite3), MySQLi, PDO_MySQL, MySQL,
- PostgreSQL and MsSQL, since all these are very similar to MySQL, you could make it so they all use the same functions(connect, disconnect, query, get, clean)
- and you could use any of them without having to edit so much, only problem is that some of them use the bind_param function so it requires some parameters in the
- query and get(bind_result) function, but that isn't a mayor deal.
- I don't know of anything else that needs work, at the moment it's rather an awesome but incomplete and needs-work BASE.
Add Comment
Please, Sign In to add comment