src/utils/Html.php
public static function vue($path, array $data = null)
		{
			$path   = \View::getFinder()->find($path);
			$str    = file_get_contents($path);
			if($data)
			{
				$tag1 = '<scr'.'ipt>';
				$tag2 = '</scr'.'ipt>';
				$json = json_encode($data);
				$str = str_replace($tag1, $tag1 . "(function () {\n\tvar \$data = $json;", $str);
				$str = str_replace($tag2, '}())' . $tag2, $str);
			}
			return $str;
		}
public static function vue($path, array $data = null)
		{
			$path   = \View::getFinder()->find($path);
			$str    = file_get_contents($path);
			if($data)
			{
				$tag1 = '<scr'.'ipt>';
				$tag2 = '</scr'.'ipt>';
				$json = json_encode($data);
				$str = str_replace($tag1, $tag1 . "(function () {\n\tvar \$data = $json;", $str);
				$str = str_replace($tag2, '}())' . $tag2, $str);
			}
			return $str;
		}
public static function vue ( $ path , array $ data = null ) { $ path = \ View :: getFinder ( ) -> find ( $ path ) ; $ str = file_get_contents ( $ path ) ; if ( $ data ) { $ tag1 = '<scr' . 'ipt>' ; $ tag2 = '</scr' . 'ipt>' ; $ json = json_encode ( $ data ) ; $ str = str_replace ( $ tag1 , $ tag1 . "(function () {\n\tvar \$data = $json;" , $ str ) ; $ str = str_replace ( $ tag2 , '}())' . $ tag2 , $ str ) ; } return $ str ; }
Loads a Vue file and optionally injects data into it

@param   string  $path
@param   mixed   $data
@return  string
Loads a Vue file and optionally injects data into it