문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

You can use views from other controllers:

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

Hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top