<?php

namespace GriffinForms\Admin\App\Html\Containers;

class Format extends \GriffinForms\Admin\App\Html\Format
{
    /**
     * All container widgets are stored in $widgets array.
     */
    protected $widgets = array();

    /**
     * Loop through widgets array and automatically set each one of them.
     */
    protected function instantiateWidgets()
    {
        foreach ($this->widgets as $widget) {
            $widget_class = '\GriffinForms\Admin\App\Html\Widgets\\' . $this->meta . '\\' . str_replace('_', '', $widget);
            $this->widgets[$widget] = new $widget_class();
        }
    }

    public function getJs()
    {

    }

    public function __construct()
    {
        $this->setAll();
        $this->instantiateWidgets();
    }
}