cake
cake

Reputation: 31

How to include a view in another view in cakephp

I have an add.ctp file, which will enable the user to add new entries, there is another view.ctp file which will list all the existing entries from the database. How would I include these existing entries within the add view page, So that user should be able to view the existing entries at the bottom of the page when he is making a new entry from add page?

Thanking you

Upvotes: 3

Views: 3539

Answers (2)

Harris
Harris

Reputation: 1138

or load the view underneath through an ajax call when an entry is clicked.

Upvotes: 1

dhofstet
dhofstet

Reputation: 9964

You could extract the view code you want to use in both views into an element.

Upvotes: 5

Related Questions