[extension] xdetailview 2.0

finally come up with a solution to layout detail view which supports nested attributes;

1st thing comes to my mind was to use colspan as parameter (same as suggestion from @CK), then i noticed that i might end up with messy span layout if i have improper values of {ItemColumns} and {ItemSpan} parameters.

the point is to make this extension simple and compatible with what we have: CDetailView and XDetailView 1.0. Qiang provides a very nice guideline in original CDetailView, so extend it for the need but not too much.

xdetailview

OK, let code talk.




<?php $this->widget('application.components.widgets.XDetailView', array(

    'data' => $model,

    'attributes' => array(

        'group1'=>array(

            'attributes' => array(

                    'account',

                    'company',

                    'city',

                    'province',

            ),

        ),

        'group2'=>array(

            'ItemColumns' => 2,

            'attributes' => array(

                    'account',

                    'company',

                    'city',

                    'province',

            ),

        ),

        'group3'=>array(

            'attributes' => array(

                'ItemColumns' => 1, // one pair per line here

                'attributes' => array(

                        'long_text_field',

            ),

        ),

    ),

)); ?>

[color="#008000"]NOTE: moved to proper section (Extensions instead of General Discussion for Yii 1.1.x)[/color]

oops, thanks.

Very useful extension. Thx