Question

I developed an application with different MVCs using the Yii Framework

For example

I created a crud layer for Student Contact details and Student Courses etc.

All worked perfectly since each had its own menu, and when clicked eachs own view rendered.

Now my client wants everything on one page, and is quite persistent, we are talking about 7 MVC that need to be displayed on one page. Each MVC has it's own controller, model and view and own DB table. How can I render all of them on one page without re-writing the whole application? Is this possible.

Was it helpful?

Solution

If I understood your problem correctly, you simply want to merge all menu items and show the full navigation on each page.

By separating menus into standalone views and including each and one of them into a navigation view, you can have a well-structured non-repeating code.

$this->renderPartial('anotherView');

is pretty much everything you might need to know to get started. This is only callable in views as $this refers to the current controller object.

OTHER TIPS

You can use views from other controllers:

$this->renderPartial('application.views.student_Contact.show',array('model'=>$model));

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top