Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GetcontrollerController extends Controller{
- public $json;
- public function beforeAction( $event )
- {
- $this->enableCsrfValidation = false;
- $this->json = Json::decode(file_get_contents("php://input"), false);
- header('content-type: text/javascript');
- return parent::beforeAction( $event );
- }
- public function actions()
- {
- return [
- 'error' => [
- 'class' => 'yiiwebErrorAction',
- ]
- ];
- }
- public function actionIndex(){
- $file = $this->json->file;
- $handle = fopen( Yii::getAlias( "@webroot" ) . '\js2\controllers\' . $file . ".js", "r" );
- while( $line = fgets( $handle ) ){
- echo $line;
- }
- global $urlpath;
- echo "n//# sourceURL=" . $urlpath . "js2/" . $file . ".js";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement