Hello.
I want to use the Uniform Contact plugin.
This plugin works fine for site/template/contact.php and site/controllers/contact.php, but not for other templates and controllers at all.
Should I do something wrong or am I supposed to fix it?
site/templates/projects.php
<input<?php e($form->hasError('name'), ' class="erroneous"')?> type="text" name="name" id="name" value="<?php $form->echoValue('name') ?>" required placeholder="Name or Company 이름 혹은 회사명">
<input name="email" type="email" value="<?php echo $form->old('email') ?>" required placeholder="E-mail 이메일">
<input type="tel" name="phone" id="phone" value="<?php $form->echoValue('phone') ?>" placeholder="Phone Number 휴대폰 번호">
<input type="text" name="inquiring_product" id="inquiring_product" value="<?php $form->echoValue('inquiring_product') ?>" placeholder="Inquiring Product 문의 제품">
<input type="text" name="product_use" id="product_use" value="<?php $form->echoValue('product_use') ?>" placeholder="Product Use 제품 용도">
<input type="text" name="quantity" id="quantity" value="<?php $form->echoValue('quantity') ?>" placeholder="Quantity 수량">
<input type="text" name="qna" id="qna" value="<?php $form->echoValue('qna') ?>" placeholder="Q&A 기타 문의 사항">
<?php echo csrf_field() ?>
<?php echo honeypot_field() ?>
<input type="submit" value="Send">
</form>
/site/controllers/project.php
<?php
return function ($page) {
$gallery = $page->images()->sortBy('sort', 'filename');
return [
'gallery' => $gallery
];
};
use Uniform\Form;
return function ($kirby)
{
$form = new Form([
'name' => [
'rules' => ['required'],
'message' => 'Name is required',
],
'email' => [
'rules' => ['required', 'email'],
'message' => 'Email is required',
],
'phone' => [
'rules' => ['required'],
'message' => 'Phone is required',
],
'inquiring_product' => [
'message' => 'Inquiring product is required',
],
'product_use' => [
'message' => 'Product use is required',
],
'quantity' => [
'message' => 'Quantity is required',
],
'qna' => [
'message' => 'Q&A is required',
],
]);
if ($kirby->request()->is('POST')) {
$form->emailAction([
'to' => 'sonahyong@gmail.com',
'from' => 'sonahyong@gmail.com',
]);
}
return compact('form');
};