1.自訂Comment清單
新增加Comment list頁面,執行命令列
> play crud:ov --template Comments/list
會產生/app/views/Comments/app/的文件中 #{crud.table /} 是表格的內容,可以替換為內容,顯示更多的列
#{crud.table fields:['content', 'post', 'author'] /}
如果要對某一列的內容進行處理
#{crud.table fields:['content', 'post', 'author']}
#{crud.custom 'content'}
}
${object.content.length() > 50 ? object.content[0..50] + '…' : object.content}
a>
#{/crud.custom}
#{/crud.table}
![1482482858205376.png PlayFramework完整實作一個APP(十)](https://img.php.cn//upload/image/324/361/775/1482482858205376.png)
2.客製化Post表單
>play crud:ov --template Posts/showc crud.form /}
#{crud.form}
#{crud.custom 'tags'}
.tags-list .tag {
cursor: pointer;
.tags-list .selected {
background: #222;
color : #f;
color: #f;
/style>
#{list items:models.Tag.findAll(), as:'tag'}
class="tag ${object.tags.contains(tag) ? 'selected' : ''}"> pan>
value="${object.tags.contains(tag) ? tag.id value="${object.tags.contains(tag) ? tag.id value="${object.tags.contains(tag) ? tag.id : ''}" /object. list}
#{/crud.custom}
#{/crud.form}
以上就是PlayFramework 實現一個
以上就是PlayFramework 實現一個
以上就是PlayFramework 實現一個(十)的內容PH,更多相關內容網(www.php.cn)!