echo CHtml::beginForm('index.php', 'post'); echo CHtml::textField('username', '', array('placeholder' => 'Enter your username')); echo CHtml::passwordField('password', '', array('placeholder' => 'Enter your password')); echo CHtml::submitButton('Login'); echo CHtml::endForm();
echo CHtml::link('Click here', array('site/index'), array('class' => 'button'));
echo CHtml::tag('div', array('class' => 'wrapper'), 'This is some text.');This example demonstrates the use of CHtml to create a `div` element with the CSS class "wrapper". The text "This is some text." is contained within the `div` element. Package library: Yii Framework.