Hi, first mind you, that I’m quite a beginner at PHP and started to work seriously with PHP since I found out about kirby Kudos to Bastian
so bear with my noobiness.
I would like to know what possibly go wrong in my uniform installation
I’ve already follow the step by step inspiration from enter link description here
Here are my codes,
Controller (contact.php)
<?php
return function($site, $pages, $page) {
$form = uniform('contact-form', array(
'required' => array('_name' => 'name','_from' => 'email'),
'actions' => array(
array(
'_action' => 'email',
'to' => '(string) $site->email()',
'sender' => 'info@topmodelagency.co.id',
'subject' => $site->title()->html() . ' - message from the contact form'
)
)
)
);
return compact('form');
};
Template (contact.php)
<?php snippet('header2') ?>
<?php snippet('form') ?>
<?php snippet('footer') ?>
Snippets for the form (form.php)
<!-- ========== CONTACT START ========== -->
<section id="contact">
<div class="parallax" data-velocity=".4" data-fit="-800" style="background-color: #181818;"></div>
<div class="tint"></div>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h2>STAY IN TOUCH</h2>
<h4>DON'T HESITATE TO CONTACT US</h4>
<div class="divider"><i class="fa fa-envelope"></i></div>
</div>
</div>
<form action="<?php echo $page->url()?>$form" method="post">
<div >
<div class="col-md-4 text-center" >
<input<?php e($form->hasError('_name'), ' class="erroneous"')?> type="text" name="_name" id="name" class="form-control" value="<?php $form->echoValue('_name') ?>" placeholder="Name" required/>
</div>
<div class="col-md-4 text-center">
<input<?php e($form->hasError('_from'), ' class="erroneous"')?> type="email" class="form-control" name="_from" id="email" value="<?php $form->echoValue('_from') ?>" placeholder="Email" required/>
</div>
<div class="col-md-4 text-center" >
<input <?php e($form->hasError('subject'), ' class="erroneous"')?> type="text" class="form-control" name="subject" id="subject" value="<?php $form->echoValue('subject') ?>" placeholder="Subject" required/>
</div>
<input type="text" name="website" id="website" class="uniform__potty" />
</div>
<div >
<div class="col-md-12 text-center" >
<textarea class="form-control" rows="6" placeholder="Message" name="message" id="message"><?php $form->echoValue('message') ?></textarea>
<?php if ($form->hasMessage()): ?>
<div class="message <?php e($form->successful(), 'success' , 'error')?>">
<?php $form->echoMessage() ?>
</div>
<?php endif; ?>
</div>
</div>
<div>
<div class="col-md-12 text-center">
<button type="submit" name="_submit" value="<?php echo $form->token() ?>"class="btn2 btn-lg"<?php e($form->successful(), "disabled")?>>SUBMIT</button>
</div>
</div>
</form>
</div>
</section>
<!-- ========== CONTACT END ========== -->
I used a modified one-pager themes for the templates. (If it helps)
I already have the same kind of controller config on other website I finished and it works. (it is not based on a theme, and is not a one pager)
What could possibly wrong in my installation?