Example:
~~~
echo Html::mediaList([
[
'heading' => 'Media heading 1',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. '.
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64',
'items' => [
[
'heading' => 'Media heading 1.1',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
[
'heading' => 'Media heading 1.2',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
]
],
[
'heading' => 'Media heading 2',
'body' => 'Cras sit amet nibh libero, in gravida nulla. ' .
'Nulla vel metus scelerisque ante sollicitudin commodo. ' .
'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.',
'src' => '#',
'img' => 'http://placehold.it/64x64'
],
]);
~~~
public static mediaList ( array $items = [], array $options = [] ) : string | ||
$items | array | the configuration of media items. The following properties can be set as array keys: - `items`: _array_, the sub media items (similar in configuration to items) (optional) - `heading`: _string_, the media heading - `body`: _string_, the media content - `src`: mixed, URL for the media article source - `img`: mixed, URL for the media image source - `srcOptions`: _array_, HTML attributes / options for the media article link (optional) - `imgOptions`: _array_, HTML attributes / options for the media image (optional) - `headingOptions`: _array_, HTML attributes / options for the media heading (optional) - `bodyOptions`: _array_, HTML attributes / options for the media body (optional) - `options`: _array_, HTML attributes / options for each media item (optional) |
$options | array | HTML attributes / options for the media list container |
Résultat | string |