Insert, save and edit the associative data is a common process in web application. Most of the related associative data is based on the ‘hasMany’ relationship. However, in this tutorial, the focus is on the ‘hasOne’ relationship e.g user has one profile. Technically, some of the developers combined the user profile information into the same user table. However, if the user profile comprises lots of data, it is recommended to separate the storage to make it more systematic. The following tutorial will guide you on how to insert, save and edit the associated data.

Add a comment

Slug is the part of the URL which identifies a particular page on web or system in an easy reading form. Slug is generated based on a specific field such as article title, name, event or any relevant field. If you have a document title (CakePHP Note 2020) and you upload it into your system the uploaded document will get its own unique ID which will be used as a reference ID to access the document. A standard URL to access the uploaded document will be eg: localhost/myCake/documents/11 which 11 is an ID (auto-generated) for the uploaded document (CakePHP Note 2020). Let say that the documents table have (id, title and year), so the slug can be generated based on the title of the documents which will generate the URL as localhost/myCake/documents/cakephp-note-2020. Use the CakePHP Tools Plugin to easily generate the slug.

Add a comment

Page 2 of 7