4 changed files with 85 additions and 8 deletions
@ -0,0 +1,60 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace AXEWEB_Blocks\Blocks\<%= ownerClass %>\<%= blockClassModel %>\Helpers; |
||||
|
|
||||
|
class <%= blockClassModel %>_Elementor_Widget extends \Elementor\Widget_Base { |
||||
|
const PLUGIN_NAME = '<%= blockFilename %>'; |
||||
|
|
||||
|
public function get_name() { |
||||
|
return self::PLUGIN_NAME; |
||||
|
} |
||||
|
|
||||
|
public function get_title() { |
||||
|
return '<%= blockClassModel %>'; |
||||
|
} |
||||
|
|
||||
|
public function get_icon() { |
||||
|
return 'eicon-plus-square-o'; |
||||
|
} |
||||
|
|
||||
|
protected function _register_controls() { |
||||
|
$this->start_controls_section( 'section_content', [ 'label' => 'Content' ] ); |
||||
|
|
||||
|
$repeater = new \Elementor\Repeater(); |
||||
|
|
||||
|
// $repeater->add_control( |
||||
|
// 'video_url', [ |
||||
|
// 'label' => 'YouTube URL', |
||||
|
// 'type' => \Elementor\Controls_Manager::URL, |
||||
|
// 'label_block' => true, |
||||
|
// 'condition' => [ |
||||
|
// 'type' => 'video', |
||||
|
// ], |
||||
|
// ] |
||||
|
// ); |
||||
|
|
||||
|
$this->end_controls_section(); |
||||
|
} |
||||
|
|
||||
|
function get_style_depends() { |
||||
|
return [ '<%= blockFilename %>' ]; |
||||
|
} |
||||
|
|
||||
|
function get_script_depends() { |
||||
|
return [ 'script-<%= blockFilename %>' ]; |
||||
|
} |
||||
|
|
||||
|
protected function render() { |
||||
|
$settings = $this->get_settings_for_display(); |
||||
|
|
||||
|
$component = new \AXEWEB_Blocks\Blocks\Scytale\<%= blockClassModel %>\<%= blockClassModel %>_Component(); |
||||
|
|
||||
|
$args = self::prepare( $settings ); |
||||
|
$component->render( $args ); |
||||
|
} |
||||
|
|
||||
|
public static function prepare( $args ): array { |
||||
|
// Prepare $args for render function. |
||||
|
return $args; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue