May 2015
Beginner
220 pages
4h 16m
English
Before reaching the part where we send and process an HTTP request, we have to provide a user interface to create a comment. We will add a form just below the title and description of the page in frontend/tpl/pages.html:
<form enctype="multipart/form-data" method="post">
<h3>Add a comment for this page</h3>
{{#if error && error != ''}}
<div class="error">{{error}}</div>
{{/if}}
{{#if success && success != ''}}
<div class="success">{{{success}}}</div>
{{/if}}
<label for="text">Text</label>
<textarea value="{{text}}"></textarea>
<input type="button" value="Post" on-click="add-comment" />
</form>The event that is dispatched after clicking on the button is add-comment. The Pages controller should handle it and fire a request ...
Read now
Unlock full access