Baidu's php static technology has roughly three types: 1. replace the Page Template File with regular expressions. 2. use ob_star Technology 3. the third-party template engine was naive at the beginning, thinking that $ pageView (& #039; index & #039;) was directly used in the controller, and then saved $ page as a static page, then debug and release... baidu's php static technology has roughly three types:
1. Replace the Page Template File with regular expressions
2. Use ob_star Technology
3. Use a third-party template engine
At first it was naive to think that it was used directly in the controller.$page=View('index');
Then$page
After debugging, I found that$page
Is an object, and no attribute records the generated html content.
Changed the ob_star technology, but added the first line of the blade Templateob_star()
, Addob_get_contents()
To get the page stream and write a file. The result is that the generated page is successfully written into the html file, but the page displayed in the browser is blank.
Static Solution .....
Reply content:
Baidu's php static technology has roughly three types:
1. Replace the Page Template File with regular expressions
2. Use ob_star Technology
3. Use a third-party template engine
At first it was naive to think that it was used directly in the controller.$page=View('index');
Then$page
After debugging, I found that$page
Is an object, and no attribute records the generated html content.
Changed the ob_star technology, but added the first line of the blade Templateob_star()
, Addob_get_contents()
To get the page stream and write a file. The result is that the generated page is successfully written into the html file, but the page displayed in the browser is blank.
Static Solution .....
Resolution starts__toString()
Triggered
Ob_start is used in the parsing process.
You can checkIlluminate\View\View
This class
You can also callIlluminate\View\View
Of__toString()
To generate a static page, as follows:
__toString();
For laravel 5 (4 should be similar)