I have created page with form in OctoberCMS with two functions onStart()
and onSave()
:
title = "my page"
url = "/blog/new-post"
layout = "octaskin"
is_hidden = 0
[survey]
==
<?php
function onStart()
{
$this['title'] = post('title');
var_dump(post());exit; // Always empty!!!
}
function onSave()
{
var_dump(post());exit; // With data
}
?>
==
{{
form_open({
files: true,
validate: true,
flash: true,
request: "onSave"
})
}}
<input name="title" type="text" value="{{ title }}">
{{ form_close() }}
I want reinit data in field "title" in case of validation fails. But in onStart()
request's data is always empty. How to access request's data from onStart()?