labelcakephp-2.7

CakePHP - use aliases instead of column name in labels


I have some columns with long and unfriendly names, which I want to edit app-wide in dynamic forms.

Is there a way to add "alias" or "title" to a column, so that echo $this->Form->input('icantshowthis'); will echo something else than "icantshowthis" as the label content?

I am aware to virtual fields and don't want to use them, since it seems like wrong practice. (this is a view issue)

pretty please??


Solution

  • You are looking for Secury in Forms for CakePHP, this obfuscate the real field names by hasing the name attributes in inputs, and may abstract that to the controllers that receives the data.

    The disvantages are when you need to insert fileds that are not part of your models.

    Hope it help!