<?php
/**
 * Copyright (c) 2016. PlatyHouse. all rights reserved.
 */

namespace platyFramework;

/**
 * script 로 외부에서 모듈을 부릅니다
 *
 * <div class='row'>
<div class='col-sm-12'>
<script type=\"text/javascript\" src=\"https://dev.apps.platyhouse.com/common/scriptA/js/?target=div_subscribe\" async></script>
<div id=\"div_subscribe\" data-module='goodmorning' data-class='subscribe' data-function='index' data-apiKey=\"{$apiKey}\"></div>
</div>
</div>
 */
class ptycommonScriptAController extends controller
{
    function js()
    {
        $data = [];
        $data['target'] = $this->request->req->target;
        $this->response->add($this->loader->view("common.scriptA.js", $data));
    }

    public function get($module, $class, $function, $accessToken)
    {
        if ($accessToken) {
            $this->checkAccessToken($accessToken);
        }

        $n = new Action($this->platyFramework, "", $module, $class, $function);
        $n->execute($_REQUEST);
    }
}