CakePHP: the best way to remove a field from an administrative forest

When I manage the user model, everything works fine. However, it also has a password field. This is a hash of the actual password.

When you save the user in the admin console, he saves a hashed password that twists everything.

What is the easiest way to exclude the field from the administrative forest with minimal interference for the amazing auto-scaffold of the admin scaffold?

thanks

+4
source share
1 answer

You want to create your own baking theme so that you can then edit the template to delete the file.

It really is that simple, http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html#modify-default-html-produced-by-baked-templates

Just copy the files from inside lib/Cake/Console/Templates/default/views to your project under app/Console/Templates/[themename]/views , and then you can edit the presentation templates.

The same applies to all other files, such as controllers and models. Then, when you bake your project, you will be asked what topic you want to use, and you can choose your own.

Here is an example from one of my projects.

enter image description here

The only thing to note is that the names of your themes must be unique!

+1
source

All Articles