CakePHP

CakePHP Custom Field Label

input label
CakePHP will generate the field label based on the attribute name in database table. However, in the database, the name for each field has been truncated for example the “Identity Card Number” has been truncate as “icno” in the database table. This field name will confuse the user if there is no proper name for the particular field.



To change label “Icno” to “Identity Card Number” open file add.ctp that consist icno field and edit "echo $this->Form->input('icno');" with add-on new array as shown below:

 

echo $this->Form->input('icno',array(
			'label'=>'Identity Card Number',
			)
	);

 

The result should be display as:

icno2

Author Information
Muhammad Asyraf bin Wahi Anuar
Web Administrator
Asyraf enjoys life and has great enthusiasm for all outdoors activities especially MTB! Don't Follow Me. I'm Lost Too -_-

Tags: ,
Muhammad Asyraf bin Wahi Anuar | Copyright 2017 | Informatic Trooper