Welcome Guest, Not a member yet? Register   Sign In
Add/Edit froms with one view and invisible controllers
#1

[eluser]suntrop[/eluser]
I noticed – as I wrote my edit() function – there are over 150 lines of code that are identical to the ones from my add() function. The view is almost the same as well. So, I want to use one view for my add and edit forms. This way seemed to be an easy way: http://ellislab.com/forums/viewthread/114016/#576706

But I don't know what the 'mock_item' model is for. And what is he doing with …
Code:
$data['item'] = $this->amodel->item($id);

I can't get my head around it, how this works :-)

Please, can anybody shed some light on it? Maybe a little more detailed description as xwero wrote.

Thanks a lot!




Theme © iAndrew 2016 - Forum software by © MyBB