These images are generated automatically when necessary, but we are going to allow the user to upload manually cropped images for each of the defined resolutions. To achieve this, we need to dynamically generate the file upload form. We will use the same technique as with the JavaScript code—with the PHP template included within the output buffer. The form template file at app/rest_slim/assets/form_html.php
is loaded via the getForm()
method into rest_slim_test.php
using the following code:
<div id="form_wrapper" class="hidden"> <?php echo $app->getForm(); ?> </div>
Parsing the created photo form inside our class gives us the advantage of easy access to all class variables, as seen in the following code:
<h3>Create new photo</h3> <p id="status"><span id="progress"></span></p> <form id="landscape" enctype="multipart/form-data"> <label>location</label> <textarea id="location" name="location">...