There are many file upload plugins for CakePHP 3 ( https://github.com/friendsofcake/awesome-cakephp#files ) and they have lots of features. But to simply attach documents to my model, I created my own functionality.
In addition to accessing the fields existing in the database, the Model can create virtual fields for consistent formatting of data that you don't want to store redundantly in your database. Common examples are full names, made up of first and last names, or item identifiers that are combinations of unique ids and descriptive names.
Elements are reusable blocks of code you can create once and use in multiple places of your site, making it easier to make changes in a single location instead of searching for all the occurrences of the same code.
For ease of access I create a common login/logout block to display on all the pages of my application.
You may have noticed references to password() and reset() functions, which are used to allow users to reset their password.
We can Add and Index (list) our users, but we still haven't set up the functions and views to allow editing and viewing our users.
With CakePHP 3, time localization is built in. Edit the
config/boostrap.pp file and you'll see:
Now we're going to work on storing our Session information in the database.
Now that we have a user, complete with username and password, we can add authentication to restrict access to our application.
Now we'll build our Controller to retrieve the data and some Views to display it.
Now we're going to update our Model to be more useful with advanced Validation.