Item Picker

class Nos\Renderer_Item_Picker
Extends Nos\Renderer.
This renderer is used to pick a item.
It displays a thumbnail of the item with buttons to manage the selected item
Item Picker UI

Configuration

property Nos\Renderer_Item_Picker::$model

The model name

property Nos\Renderer_Item_Picker::$appdesk

URL of the model appdesk.

property Nos\Renderer_Item_Picker::$size

Size of the thumbnail. Default 64

property Nos\Renderer_Item_Picker::$texts

Labels use for UI

empty:Label when no item selected. Default No item selected.
add:Label of button to pick an item. Default Pick an item.
edit:Label of button to pick another item. Default Pick another item.
delete:Label of button to un-select item. Default Un-select this item.
property Nos\Renderer_Item_Picker::$defaultThumbnail

URL of the default thumbnail

Methods

Nos\Renderer_Item_Picker::renderer($renderer)
Parameters:
  • $renderer (Model) – Array the attributes.
Returns:

The <input> tag with JavaScript to initialise it

Displays a item picker renderer in a standalone manner.

Example

Adding a page item picker in a CRUD form configuration:

<?php

return array(
    'label' => __('Page:'),
    'renderer' => 'Nos\Renderer_Item_Picker',
    'renderer_options' => array(
        'model' => 'Nos\Page\Model_Page',
        'appdesk' => 'admin/noviusos_page/appdesk',
        'defaultThumbnail' => 'static/apps/noviusos_page/img/64/page.png',
        'texts' => array(
            'empty' => __('No page selected'),
            'add' => __('Pick a page'),
            'edit' => __('Pick another page'),
            'delete' => __('Un-select this page'),
        ),
    ),
);
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.