CActiveForm template


Is there any way to put my form into template by default with CActiveForm widget.

I need that all my forms will by in template by default like:

<div class="block">

 <div class="myFormCss">

   <!-- the widget starts form -->

	<form ....>



   <!-- the widget ends form -->



How can I put my all forms into template by extending CActiveForm widget?

This template not for each row or field it’s for all form one template, it’s the way I can style my forms.


It doesn’t seem like adding two div tags is worth it, but you’d probably just want your extension to override CActiveForm.init() and add in your code to print your divs around the form tags; then override run() and call parent::run() before closing your divs.