Yii extends CHtml for working with text fields

Hello. I am currently writing another project on Yii and would like to share some developments. In this article, I would like to describe how you can extend the functionality of the framework using the inheritance of the CHtml , CActiveForm classes . There is nothing complicated and innovative here, I just would like to share this. My task was to create 2 elements:
  • The text that, when clicked, turns into input
  • A block with a certain width, which may not fit all the necessary text, but when you hover, a hint appears


Here is an example of the result of the following code (the code after the habracat):

image

beginWidget('MActiveForm', array(

'id'=>'personal-form',

'enableAjaxValidation'=>false,

)); 

 

?>

errorSummary($model); ?>

 

    

labelEx($model,'gender'); ?>

labelField($model,'gender'); ?>

error($model,'gender'); ?>



 

    

labelEx($model,'firstname'); ?>

labelField($model,'firstname'); ?>

error($model,'firstname'); ?>



 

    

labelEx($model,'secondname'); ?>

labelField($model,'secondname'); ?>

error($model,'secondname'); ?>



 

    

labelEx($model,'lastname'); ?>

labelField($model,'lastname'); ?>

error($model,'lastname'); ?>


Also popular now: