CakePHP 3 Tutorial 11: Virtual Fields

Submitted by naidim on Wed, 09/28/2016 - 12:13

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.

CakePHP 3 Tutorial 10: Elements

Submitted by naidim on Tue, 09/27/2016 - 11:52

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.

Create src/Template/Element/admin.ctp