High guys,I have three models that i am using in Cakephp,I create 3 views for my models which are linked by the second model.The problem is how can i retrieve the id of the first model when i want to do a final save?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Under the assumption that you’re saving the three models in three separate page requests, it should suffice to simply store the saved model data in your session. That way you can read it in the 2nd and 3rd page request and include the necessary data in your forms and processing.
If you’re doing it all in the same request, then Moyed’s idea works, you can get the ID of a saved row through the model: