⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
work
/
themes
/
Mytravel
/
Tour
/
Blocks
/
Edit File: Testimonial.php
<?php namespace Themes\Mytravel\Tour\Blocks; use Modules\Media\Helpers\FileHelper; use Modules\Template\Blocks\BaseBlock; class Testimonial extends BaseBlock { 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' => 'position', 'type' => 'input', 'inputType' => 'text', 'label' => __('Position') ], [ 'id' => 'avatar', 'type' => 'uploader', 'label' => __('Avatar Image') ], ] ], [ 'id' => 'style', 'type' => 'radios', 'label' => __('Style'), 'values' => [ [ 'value' => 'index', 'name' => __("Style 1") ], [ 'value' => 'style_2', 'name' => __("Style 2") ], ], ], ], 'category'=>__("Other Block") ]); } public function getName() { return __('List Testimonial'); } public function content($model = []) { $blade = (!empty($model['style'])) ? $model['style'] : 'index'; return $this->view("Tour::frontend.blocks.testimonial.{$blade}", $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; } }
Simpan