Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 44197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:36:52+00:00 2026-05-10T15:36:52+00:00

I am creating a website in CakePHP and I am kind of new on

  • 0

I am creating a website in CakePHP and I am kind of new on it. I couldn’t find good resources on this matter, so there you go:

I have a three table structure for registering users: Users, Addresses and Contacts. I have to build a view with info of all three tables like:

 Full Name:         [          ] (from Users) Shipping Address:  [          ] (from Address) Mobile Phone:      [          ] (from Contact) e-Mail Address:    [          ] (from Contact) 

What is the best way to deal with this situation. Specially for saving. Creating a new Model to represent this, that will have a save() method itself (Maybe a sql view in the database) Create a Controller to deal with this View that binds or unbinds info

I wonder still how I will handle both contacts as they will be 2 different INSERT‘s

Any hint or resources I can dig of I will be glad.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:36:52+00:00Added an answer on May 10, 2026 at 3:36 pm

    If your using the latest 1.2 code, check out Model::saveAll in the api

    eg. Your view might look something like this:

    echo $form->create('User', array('action' => 'add'); echo $form->input('User.name'); echo $form->input('Address.line_1'); echo $form->input('Contact.tel'); echo $form->end('Save'); 

    Then in your Users controller add method you’d have something like:

    ...  if($this->User->saveAll($this->data)) {  $this->Session->setFlash('Save Successful');  $this->redirect(array('action' => 'index')); } else {  $this->Session->setFlash('Please review the form for errors'); }  ... 

    In your User model you will need something like:

    var $hasOne = array('Address', 'Contact'); 

    Hope that helps!

    http://api.cakephp.org/class_model.html#49f295217028004b5a723caf086a86b1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I wonder why cacheLength doesn't work, but had trouble with… May 11, 2026 at 2:10 pm
  • added an answer I had the same question when writing a program to… May 11, 2026 at 2:10 pm
  • added an answer What you want to do is activate archive mode. vi… May 11, 2026 at 2:10 pm

Related Questions

I am creating a website that has 5 different sub-sites each with the same
I am planning on creating a small website for my personal book collection. To
I am creating an installer for an ASP.Net website using WiX. How do you
I am considering creating my own website using Java and am trying to decide
I am working on creating a website in Django which consists of two parts:
Just want advice on how to think and do the following, I am creating
I am creating a website and on one particular page, am wanting to send
How can I make a website multilingual? I want to create a website and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.