CHtml passing Class to form

Discuss everything related to ApPHP MVC Framework. All versions. Any questions related to the Framework developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

CHtml passing Class to form

Postby paragate » Jul 13th, '17, 08:51

Wondering how.. or is it of use to insert in CGridView.php line 133

Code: Select all

$classForm  = self::params('options.classForm', array());
then inser into line 224

Code: Select all

$output .= CHtml::openForm($actionPath, 'get', array('id'=>'frmFilter'.$modelName)).self::NL;


Code: Select all

$output .= CHtml::openForm($actionPath, 'get', array('class'=>(!empty($classForm['class']) ? $classForm['class'] : ''),'id'=>'frmFilter'.$modelName)).self::NL;

that way we can pass a class to the Form tag <Form class="table">

Code: Select all

echo CWidget::create('CGridView', array(
                        'model'             => 'ReportsProjects',
                        'actionPath'        => 'reportsProjects/manage',
                        'condition'         => '',
                        'defaultOrder'      => array('project_name'=>'ASC'),
                        'passParameters'    => true,
                        'pagination'        => array('enable'=>true, 'pageSize'=>20),
                        'sorting'           => true,
                        'options'           => array(
                                  'classForm'    => array('class'=>'table'),
                                                'filterDiv'    => array('class'=>''),
                                                'filterType'   => 'default',
                                                'gridWrapper'  => array('tag'=>'', 'class'=>''), //head th class
                                                'gridTable'    => array('class'=>'table'),
                        'filters'           => array(.....

regards henrik

Site Admin
Site Admin
Posts: 6170
Joined: Jan 7th, '09, 23:18

Re: CHtml passing Class to form

Postby administrator » Jul 16th, '17, 10:52

Thanks, we'll add such option in the next version.

Return to “ApPHP MVC Framework {developers/users}”