Php-angular/think-angular/php template engine and php template engine

Source: Internet
Author: User
Tags php template

Php-angular/think-angular/php template engine and php template engine

I recently learned thinphp5 and found a useful template engine, think-angular,

This template engine has the following features: no additional tag definition is required, and all attributes are used for definition. The written template files are neat when the IDE formatting code, because the set template file is still standard html,

Note: Multiple Template commands can be used on a tag, and the commands must follow the order. Therefore, pay attention to the order of commands,

Project address: https://github.com/top-think/think-angular

Document address: https://www.kancloud.cn/shuai/php-angular/127397

<? Phpuse think \ angular \ Angular; require '.. /src/Angular. php '; $ data = ['title' => 'homepage', 'LIST' => [['id' => 1, 'name' => 'user _ 1', 'email '=> 'email _ 1@qq.com', 'status' => 1], ['id' => 2, 'name' => 'user _ 2', 'email '=> 'email _ 2@qq.com', 'status' => 0], ['id' => 3, 'name' => 'user _ 3', 'email '=> 'email _ 3@qq.com', 'status' =>-1], ['id' => 4, 'name' => 'user _ 4', 'email '=> 'email _ 4@qq.com', 'status' => 1], ['id' => 5, 'name' => 'user _ 5', 'email '=> 'email _ 5@qq.com ', 'status' => 1],],]; // tree structure $ menus = [['title' => 'menu 1 ', 'sub' => [['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 2 ', 'sub' => [['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 100'], ['title' => 'menu 3 ', 'sub' => ['title' => 'dish Single 3.1 ', 'sub' => [['title' => 'menu 3.1.1'], ['title' => 'menu 3.1.2 '], ['title' => 'menu 3.1.3 ', 'sub' => [['title' => 'menu 3.1.3.1 '], ['title' => 'menu 3.1.3.2 '],], ['title' => 'menu 3.2'], ['title' => 'menu 100'], ['title' => 'menu 100'],],]; $ view-> assign ('pagecount ', 100); $ view-> assign ('P', isset ($ _ GET ['P'])? $ _ GET ['P']: 1); $ view-> assign ('page', function ($ p) {return 'index. php? P = '. $ p;}); // set data to the template engine $ view-> assign ($ data); $ view-> assign ('start _ time', $ start_time ); $ view-> assign ('menus', $ menus); // test php-model label transfer double quotation marks $ view-> assign ('name ', '"php" and "think-angular"'); // output the parsing result $ view-> display ('index '); // return the output result // $ html = $ view-> fetch ('index'); // echo $ html; // obtain the mixed code // $ php_code = $ view-> compiler ('index ');
PHP
<Div php-extends = "base"> </div> <div php-block = "main" class = "container"> <div class = "jumbotron"> Template

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.