How to include a view in another view in cakephp

I have an add.ctp file that will allow the user to add new records, there is another view.ctp file that lists all existing records from the database. How to include these existing entries in the add view page so that the user can view existing entries at the bottom of the page when he makes a new entry from the sub page?

Thank you

+3
source share
2 answers

You can extract the view code that you want to use in both views in element .

+5
source

or load the view using an ajax call when a record is clicked.

+1
source

Source: https://habr.com/ru/post/1721850/


All Articles