Wiki articles in category Tips tagged with "form"

Showing 1-4 of 4 items.

Extending CActiveForm for some form display fixes and language tweaks

Created 13 years ago by Trejder, updated 13 years ago by Trejder.

In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
Viewed: 24 177 times
Version: 1.1
Category: Tips

Update two models with one view

Created 12 years ago by sensorario, updated 12 years ago by SebK.

Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).

9 3
Viewed: 55 698 times
Version: 1.1
Category: Tips

FORM with GET method causes repeated stacking of URL Parameters

Created 10 years ago by Kartik V, updated 10 years ago by toph.

// In Yii 1.x $form = $this->beginWidget('CActiveForm', [

'id' => 'order-search-form',
'method' => 'get',

]); echo $form->textInput($searchModel, 'id'); echo CHtml::submitButton('Find', ['class' => 'btn btn-primary']); $this->endWidget(); `

7 2
Viewed: 61 918 times
Version: all
Category: Tips

Create Form With DynamicModel

Created 9 years ago by Misbahul D Munir, updated 9 years ago by Misbahul D Munir.

In yii2 we can create form without create FormModel. Here we go

4 0
Viewed: 47 508 times
Version: 2.0
Category: Tips
Tags: form, model, yii2