Rather Newish to OOP, Controller question |
So I have something working how I wish it to but I am not sure it is the best way to do it. Essentially, I have a controller called PROJECT.php and two methods inside that controller, JOIN($project_id) and ENTER($project_id).
The join() is simple and queries information about the PROJECT from the database and sends it to the join.php view. The join.php view has a simple form: PHP Code: <?php So it is simply posting it to the project($project_id) method, which checks a permission and if passes submits data to the database. PHP Code: public function enter($project_id) { The problems I currently have: 1) How do I prevent someone from just loading the enter($project_id) controller without using the join($project_id) controller? 2) How can I setup error checking? I would rather do this correctly (globally) as I am pretty early in this project and prefer to take my time and do things the right way. I know Codeigniter does basic error checking by default but to what extent? 3) Anything you would do different to get the same result? Is anything blatantly wrong with the above that I should kill right now before I get too far in? Thanks! Looking forward to getting better at OOP and Codeigniter. |
Messages In This Thread |
Rather Newish to OOP, Controller question - by BamaStangGuy - 05-19-2016, 07:08 PM
RE: Rather Newish to OOP, Controller question - by Wouter60 - 05-19-2016, 10:49 PM
RE: Rather Newish to OOP, Controller question - by BamaStangGuy - 05-19-2016, 11:37 PM
RE: Rather Newish to OOP, Controller question - by BamaStangGuy - 05-20-2016, 12:26 AM
RE: Rather Newish to OOP, Controller question - by InsiteFX - 05-20-2016, 02:45 AM
RE: Rather Newish to OOP, Controller question - by BamaStangGuy - 05-20-2016, 02:59 AM
RE: Rather Newish to OOP, Controller question - by BamaStangGuy - 05-20-2016, 03:07 AM
RE: Rather Newish to OOP, Controller question - by Wouter60 - 05-20-2016, 06:55 AM
RE: Rather Newish to OOP, Controller question - by mwhitney - 05-20-2016, 02:01 PM
RE: Rather Newish to OOP, Controller question - by BamaStangGuy - 05-20-2016, 02:39 PM
|