Template variationΒΆ

The configuration of a template variation is assumed to be application_name::variation/template_name.

init:

Optional. A callback function. Call to initialize a Nos\Template\Variation\Model_Template_Variation. Returns an array with fields names in keys and the initial values in values.

admin:

Array

layout:How the form, for item build with the driver, looks like and where fields are displayed inside it.
fields:All fields displayed in the form.

See also

Crud Controller

layout:

Optional. A callback function. If exist, the return value overload the template configuration. Take the Nos\Template\Variation\Model_Template_Variation in parameter.

cols:

Optional. A callback function. If exist, the return value overload the template configuration. Take the Nos\Template\Variation\Model_Template_Variation in parameter.

rows:

Optional. A callback function. If exist, the return value overload the template configuration. Take the Nos\Template\Variation\Model_Template_Variation in parameter.

file:

Optional. A callback function. If exist, the return value overload the template configuration. Take the Nos\Template\Variation\Model_Template_Variation in parameter.

screenshot:

Optional. A callback function. If exist, the return value overload the template configuration. Take the Nos\Template\Variation\Model_Template_Variation in parameter.

See also

Templates

<?php
return array(
    'cols' => function($tpvar) {
        return int_val($tpvar->tpvar_data['cols']);
    },
    'admin' => array(
        'layout' => array(
            'content' => array(
                'expander' => array(
                    'view' => 'nos::form/expander',
                    'params' => array(
                        'title'   => __('Configuration'),
                        'options' => array(
                            'allowExpand' => false,
                        ),
                        'content' => array(
                            'view' => 'nos::form/fields',
                            'params' => array(
                                'fields' => array(
                                    'menus->principal->menu_id',
                                    'cols',
                                ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
        'fields' => array(
            'menus->principal->menu_id' => array(
                'label' => __('Menu'),
                'renderer' => 'Nos\Renderer_Item_Picker',
                'renderer_options' => array(
                    'model' => 'Nos\Menu\Model_Menu',
                    'appdesk' => 'admin/noviusos_menu/menu/appdesk',
                    'defaultThumbnail' => 'static/apps/noviusos_menu/img/64/menu.png',
                    'texts' => array(
                        'empty' => __('No menu selected'),
                        'add' => __('Pick a menu'),
                        'edit' => __('Pick another menu'),
                        'delete' => __('Un-select this menu'),
                    ),
                ),
            ),
            'cols' => array(
                'label' => __('Column number'),
                'form' => array(
                    'type' => 'number',
                ),
            ),
        ),
    ),
);
Read the Docs v: elche
Versions
latest
stable
elche
dubrovka
chiba.2
chiba.1
Downloads
pdf
htmlzip
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.