Home > Java > javaTutorial > body text

PlayFramework completely implements an APP (10)

黄舟
Release: 2016-12-23 16:48:16
Original
1441 people have browsed it

1. Customize the Comment list

Add a new Comment list page, execute the command line

> play crud:ov --template Comments/list

 

will generate /app/views/Comments/list.html

In the generated file #{crud.table /} is the content of the table, which can be replaced with the following content to display more columns

#{crud.table fields:['content', 'post', 'author'] / }

If you want to process the content of a certain column

#{crud.table fields:['content', 'post', 'author']}
#{crud.custom 'content'}
< ;a href="@{Comments.show(object.id)}">
${object.content.length() > 50 ? object.content[0..50] + '…' : object. content}

#{/crud.custom}
#{/crud.table}

PlayFramework completely implements an APP (10)

2. Customize Post form

>play crud:ov --template Posts/show
" < :      .tags-list .selected {

          background: # 222;

                                                                                                   .getElementById('h'+ tagEl.id); {

              tagEl.className = 'tag selected';

                                                                                                      

                                 s.Tag.findAll() , as:'tag'}

                                                                                                                                                                       '}">
                                                                                 ="${ object.tags.contains(tag) ? tag.id : ''}" />
          #{/list}
                                                                           



The above is the content of PlayFramework to completely implement an APP (10). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!




Related labels:
app
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!