Default UI: | |
---|---|
Hover state UI: | |
Hover state with a selected media UI: | |
Possible values are image (default) or all.
Options for the inputFileThumb widget used to render the UI. See the inputFileThumb documentation for all available options.
Note
The inputFileThumb.file key will automatically be populated with the URL of the media if a value is provided in the renderer.
Parameters: |
|
---|---|
Returns: | The <input> tag with JavaScript to initialise it |
Displays a media selector in a standalone manner.
Adding a media in a CRUD form configuration:
<?php
return array(
'label' => '',
'renderer' => 'Nos\Media\Renderer_Media',
'renderer_options' => array(
'mode' => 'image',
'inputFileThumb' => array(
'title' => 'Title of the image',
),
),
);
Displaying a media selector:
<?php
echo Nos\Media\Renderer_Media::renderer(array(
'name' => 'my_image',
'class' => 'some_class',
'value' => 2, // ID of the previously selected media
'renderer_options' => array(
'mode' => 'image',
'inputFileThumb' => array(
'title' => 'Title of the image',
),
),
));