$application->handle(); show a "Wrong number of parameters"

My php version is 7.3.3, phalcon 4.0.0-alpha.3

I start learning phalcon Basic Tutorial,

my document is localhost/phalcon/tutorial

$response = $application->handle(); //just here show a Exception: Wrong number of parameters

I tried https://forum.phalconphp.com/discussion/19151/applicationhandle-triggers-a-wrong-number-of-parameters-error-af this method method1: $response = $application->handle(""); // this is working, but not going to each view phtml file

method2: $request = new Phalcon\Http\Request(); $response = $application->handle($request->getURI()); show Exception: PhalconController handler class cannot be loaded //my application directory is localhost/phalcon/tutorial

$application->handle() seems need a string parameter;

so how to solve it



1.6k

if you made the structure manually it could have something missing

to prevent these kind of problems i highly suggest you install phalcon dev-tools and use them to create your project

if you can paste the code at public/index.php

if you made the structure manually it could have something missing

to prevent these kind of problems i highly suggest you install phalcon dev-tools and use them to create your project

if you can paste the code at public/index.php

Even I git clone from github, this problem is same.

But the same code file in phalcon v3.4 works fine.



1.8k

It's a change from 3.x to 4.x - the line now needs to read:

$response = $application->handle($_SERVER['REQUEST_URI']);

there is a more framework pure version, but that's the one I've got and it's worked.

hth