Welcome Guest, Not a member yet? Register   Sign In
Best way to project, plan and structure an app with CI
#9

I do it this way:

1) I think about, what kind of data I want to show
-> I get my routes

2) I desgin my views.

3) 2) results in my database structure and via normalizing I get the correct "joins" for later.
I can structure my model.

3) By 1) I can structure my controller.
Do I need arguments? Where do they come from? What if an error occurs? How to handle it?

4) After my application is done I clean up my code.

Instead of writing over and over again sth. like

$this->load->model('mymodel');
$this->mymodel->method;

I do sth like this:

protected $model = 'mymodel';

And then I can use

$this->{$this->model}->method();

just in case I have to edit "mymodel" for what reasons ever and with this way I am sure not to forget one.

But this is not really neccesary. Someone could use "search and replace" instead.
Reply


Messages In This Thread
RE: Best way to project, plan and structure an app with CI - by hobbyci - 08-27-2020, 04:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB