29 lines
977 B
PHP
29 lines
977 B
PHP
<h2><?= $title; ?></h2>
|
|
|
|
<?= validation_errors(); ?>
|
|
|
|
<?= form_open_multipart('posts/create');?>
|
|
<!--This route will go to the Posts controller and to the create method -->
|
|
<div class="form-group">
|
|
<label >Title</label>
|
|
<input type="text" class="form-control" name="title" placeholder="Add title">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Body</label>
|
|
<textarea id="editor1" class="form-control" name="body"
|
|
placeholder="Add Body"></textarea>
|
|
</div>
|
|
<div class = "form-group">
|
|
<label>Category</label>
|
|
<select name="category_id" class="form-control">
|
|
<?php foreach($categories as $category): ?>
|
|
<option value="<?= $category['id']; ?>"><?= $category['name']; ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class = "form-group">
|
|
<label>Upload Image</label>
|
|
<input type= "file" name = "postimage" size = "20">
|
|
</div>
|
|
<button type="submit" class="btn btn-default">Submit</button>
|
|
</form>
|