Example #1
0
 private function parseHTML()
 {
     $this->parsed_html = $this->page_html;
     $out_arr = null;
     preg_match_all('/\\[\\[(.*?)\\]\\]/', $this->page_html, $out_arr);
     for ($i = 0; $i < count($out_arr[1]); $i++) {
         // first remove all spaces
         $code = str_replace(' ', '', $out_arr[1][$i]);
         $block = BlockFactory::build_block($code);
         $this->parsed_html = str_replace($out_arr[0][$i], $block->getHtml(), $this->parsed_html);
         $this->parsed_js .= $this->validateJavaScript($block->getJS(), $code);
         $this->parsed_css .= $block->getCSS();
         $this->checkIncludesUniq($block->js_includes_arr);
     }
 }
Example #2
0
 /**
  * Atgriež AJAX pieprasījuma rezultātu JSON formātā
  *
  * @param   Request     $request    POST pieprasījuma objekts
  * @return  Response    Rezultāts JSON formātā
  */
 public function getData(Request $request)
 {
     $param = $request->input("param");
     $block = BlockFactory::build_block($param);
     return response()->json(['success' => 1, 'html' => $block->getHtml(), 'data' => $block->getJSONData()]);
 }