<?php

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly


class Widget_Title extends Widget_Base {

    public function get_name() {
        return 'angel-title';
    }

    public function get_title() {
        return __( 'Section Title', 'angel' );
    }

    public function get_icon() {
        return 'eicon-type-tool';
    }

    public function get_categories() {
        return [ 'angel' ];
    }

    /**
     * A list of scripts that the widgets is depended in
     * @since 1.3.0
     **/


    protected function _register_controls() {
        $this->start_controls_section(
            'section_tab',
            [
                'label' => __( 'Content', 'angel' ),
            ]
        );

        $this->add_control(
            'section_heading',
            [
                'label'       => __( 'Heading', 'angel' ),
                'type'        => Controls_Manager::TEXT,
                'default'     => __( 'Section Heading', 'angel' ),
            ]
        );

        $this->add_control(
		    'section_desc',
		    [
			    'label'       => __( 'Description', 'angel' ),
			    'type'        => Controls_Manager::TEXTAREA,
			    'default'     => __( 'Section Subtitle', 'angel' ),
			]
	    );

        $this->end_controls_section();
    }

    protected function render() {
        $settings = $this->get_settings();
        ?>
       <div class="secotionTitle">
          <h2><span><?php echo $settings['section_heading']  ?></span><?php echo $settings['section_desc']  ?></h2>
        </div>

    <?php
    }

    protected function _content_template() { ?>

        <div class="secotionTitle">
            <h2><span>{{ settings.section_heading }}</span>{{ settings.section_desc }}</h2>
            
        </div>

    <?php }
}
