04-05-2018, 04:31 AM
Pages: 1 2
04-05-2018, 06:47 AM
04-06-2018, 12:34 AM
helper(['form', 'url']);
if (! $this->validate([]))
{
echo view('Signup', [
'validation' => $this->validation
]);
}
else
{
echo view('Success');
}
is a exceptionHandler
if (! $this->validate([]))
{
echo view('Signup', [
'validation' => $this->validation
]);
}
else
{
echo view('Success');
}
is a exceptionHandler
04-06-2018, 09:57 AM
What message is the Exception saying?
04-07-2018, 01:03 AM
"Argument 1 passed to helper() must be of the type string, array given, called in C:\xampp\htdocs\ci4m_framework\application\Controllers\Login.php on line 10"
line 10 -> helper(['form', 'url']);
my source:
public function index()
{
//echo view('w_login');
$validation = \Config\Services::validation();
helper(['form', 'url']);
//library(['validation']);
//
//
//
//
//
//
// $validation->setRules([
// 'id' => 'required',
// 'pw' => 'required|min_length[10]'
//]);
//
if (! $this->validate([]))
{
echo view('w_login', [
'validation' => $this->validation
]);
}
else
{
echo view('w_login');
}
}
line 10 -> helper(['form', 'url']);
my source:
public function index()
{
//echo view('w_login');
$validation = \Config\Services::validation();
helper(['form', 'url']);
//library(['validation']);
//
//
//
//
//
//
// $validation->setRules([
// 'id' => 'required',
// 'pw' => 'required|min_length[10]'
//]);
//
if (! $this->validate([]))
{
echo view('w_login', [
'validation' => $this->validation
]);
}
else
{
echo view('w_login');
}
}
04-08-2018, 06:22 AM
modified helper(['form', 'url']); in helper('form', 'url');
in line if (! $this->validate([]))
exception
"Call to undefined method Login::validate()"
in line if (! $this->validate([]))
exception
"Call to undefined method Login::validate()"
04-08-2018, 07:58 PM
Quote:"Argument 1 passed to helper() must be of the type string, array given, called in C:\xampp\htdocs\ci4m_framework\application\Controllers\Login.php on line 10"
It tells you exactly what the error is there. The `helper()` method doesn't currently allow more than one helper to be loaded at a time. Hence, it requires a string, not an array. It probably should, and I'll make an issue to that affect to remind me, but doesn't currently. In your case, it's not biggie - the url helper is loaded by default.
04-08-2018, 11:49 PM
it works fine.
@Lonnie You already did it (https://github.com/bcit-ci/CodeIgniter4/...40c1b7b97b)
@gra are you sure to use the latest version ?
@Lonnie You already did it (https://github.com/bcit-ci/CodeIgniter4/...40c1b7b97b)
@gra are you sure to use the latest version ?
04-08-2018, 11:58 PM
used : https://github.com/bcit-ci/CodeIgniter4.git -> master
04-09-2018, 12:07 AM
ok, no commit on this branch since 24 Jun 2016 and helper() accept arrays since 20 Sep 2016
use the develop branch.
use the develop branch.
Pages: 1 2