<?php namespace Pratik\Controllers;



use CodeIgniter\Controller;

use Pratik\Models\Pratik_Model;



class Setup extends Controller

{

	public $data = array();

	public $model = array();

    function __construct()

	{
        $this->model = new Pratik_Model();

        $this->session = \Config\Services::session();

		$this->request = \Config\Services::request();

    }

	public function index()
	{	
		$module =  $this->request->getPostget('module');
		$config =  $this->request->getPostget('config');
		if(!$config) $config = 'basic';
		if($module)
		{
			$module_path = "\Pratik\Config\\".$module."_Config";
			$elements =  new $module_path();
			$this->model->setupTable($module,$elements->$config);
		}

		$this->data['page_title']='Kurulum';

		$this->data['menu']=array('setup');

		return view('Admin\setup\setup', array('data'=>$this->data));

	}



	//--------------------------------------------------------------------



}

