Home >Java >javaTutorial >PlayFramework completely implements an APP (10)

PlayFramework completely implements an APP (10)

黄舟
黄舟Original
2016-12-23 16:48:161502browse

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)!




Statement:
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