Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
trouvaille
/
Template
/
Blocks
:
Testimonial.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Modules\Template\Blocks; use Modules\Media\Helpers\FileHelper; class Testimonial extends BaseBlock { public function getOptions(){ return [ 'settings' => [ [ 'id' => 'title', 'type' => 'input', 'inputType' => 'text', 'label' => __('Title') ], [ 'id' => 'list_item', 'type' => 'listItem', 'label' => __('List Item(s)'), 'title_field' => 'title', 'settings' => [ [ 'id' => 'name', 'type' => 'input', 'inputType' => 'text', 'label' => __('Name') ], [ 'id' => 'desc', 'type' => 'textArea', 'label' => __('Desc') ], [ 'id' => 'number_star', 'type' => 'input', 'inputType' => 'number', 'label' => __('Number star') ], [ 'id' => 'avatar', 'type' => 'uploader', 'label' => __('Avatar Image') ], ] ], ], 'category'=>__("Other Block") ]; } public function getName() { return __('List Testimonial'); } public function content($model = []) { return view('Template::frontend.blocks.testimonial.index', $model); } public function contentAPI($model = []){ if(!empty($model['list_item'])){ foreach ( $model['list_item'] as &$item ){ $item['avatar_url'] = FileHelper::url($item['avatar'], 'full'); } } return $model; } }