Hello everyone, i am new in yii although not new in programming in general. My question to all of you is related of how should i model a piece of code according to the yii’s way of organization (3-tier)
I wanted to have a permanent menu inside my website. in fact this menu is database driven. So the first thing is to have a class for this menu which is pretty straight-forward.
To have a function that renders a submenu is the most simple way to do it. Although I do not think it is appropriate for yii. So what I did was to create a controller, a certain action for this controller which will render a submenu and finally of course a view, which will be rendered with the renderPartial function since I do not want an entire new page to load.
Previously I would have an ajax call to some php file to render the menu and get my (dynamic) submenu. Now, with the second approach, I have the ajax call something like "index.php?r=menu/action&menuid=1"
Is this a reasonable way to do it or am I being paranoid and there is a much simpler solution?
I am still trying to adapt to the whole Model-Controller-View way of programming
Thank you all, this is my first topic!