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 9137949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:11:35+00:00 2026-06-17T09:11:35+00:00

Background I was given the task of writing a Small Business online database. This

  • 0

Background

I was given the task of writing a Small Business online database. This database is to include a lot of info as well as info on their directors and branches. Since any business can have an unlimited amount of directors and branches, I need to create a database that is not limited to just one director and/or branch.

What do I have

Currently I have 3 tables.

smmes [id, company_name, trading_name, business_address, registration_number, tax_reference, vat_number, bbbee_status, employees, awards, created, modified]
ownerships [id, smme_id, name, surname, gender, age, race, disability, qualification, created, modified]
branches [id, smme_id, location, contact_number, contact_person, created, modified]

Note: smme_id is the id of the company in smmes that the branch or director belongs to.

And I have a view for the SMME’s.

What is my question

I’m VERY new to cakePHP (in fact, this is my first app I’m creating with cakePHP). I want to know how I can make one form where a user can enter all this detail and then add the details for all directors and branches from one view. I would prefer that they do not have various views to go through to create all the details. Add to that, this one view should then save all the data to the correct tables with the correct smme_id.

Is this possible or should I rather leave cakePHP and write it manually.

  • 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. Editorial Team
    Editorial Team
    2026-06-17T09:11:36+00:00Added an answer on June 17, 2026 at 9:11 am

    You can load model on demand in your controller and then pass model specific data(received from posted form) to loaded model’s save method.

    public function detail(){
    
        if($this->request->is('post')): // update only when form is posted
    
            $this->loadModel('ownerships');
            $owner_name= $this->request->data['Ownername'];
            $ownerships_data = array('Ownership' = > array(
                                 'name' = > $owner_name
                                 //add other keys from posted form
                                 )
                           ); 
            $this->Ownership->saveAll($ownerships_data);
        // load other models for saving posted data in related tables
        endif;
    }
    

    Similarly load other models and pass fields from posted form as array to it’s save method.
    Suppose URL format is http://example.com/director/detail.So you would like to put above method(termed as action in MVC terminology) in app/controllers/directors_controller.php

    Generally if URL format is http://somesite.com/abc/xyz it will look for xyz action in
    app/controllers/abcs_controller.php

    You can read more about cake conventions here

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

Sidebar

Related Questions

This feature worked a bit, then stopped working. Background: Given a user is logged
Can someone give me some info/background info on how I might go about writing
(See this question and this question for background...) Given: grid = new Slick.Grid(#myGrid, data,
I am trying to run a task in the background checking a database for
I have given a table background image using css background-image property. The cells are
Given IE6, an UL-LI list and a background image for the UL container. <style>
Sometimes pdf might have a transparent background. And In my application I have given
I would really like some advice here, to give some background info I am
I would like to launch an app into the background on a given day/time
I have an app that runs in the background (minimized/task tray). I need to

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.