We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Wrong behaviour in php7

So, we had a working aplication on php5.6 and we updated to 7.0. Most of the app is still working properly but there is this one thing we cannot sort out.

When I navigate to '/ajax/sendContact' it returns a 404 error and shows the 404 error page but I've got a controller named AjaxController whit a sendContact. So i went to the dispacher and deactivated the not found handler. Now, instead of the 404 page it dumps the code in the controller and throws an exception. Anybody knows whats happening?

//
            var_dump($e);
            $contenido = ob_get_contents();
            ob_end_clean();
            $new_contacto->soap_exception = $contenido;

            if ($new_contacto->save() === false) {
                var_dump("error");
            } 
        }

        if ($new_contacto->save() === false) {
            var_dump("error");
        }

        echo $new_contacto->http_response_code;

    }

}
AjaxController handler class cannot be loaded

#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('AjaxController ...', 2)
#1 [internal function]: Phalcon\Dispatcher->_dispatch()
#2 [internal function]: Phalcon\Dispatcher->dispatch()
#3 /var/www/html/webpromos_adri/public/index.php(28): Phalcon\Mvc\Application->handle()
#4 {main}

AjaxController handler class cannot be loaded is fairly self-explanatory; your autoloader cannot find the file to load the class.

What is your AL strategy? Phalcon/composer/custom?



1.4k
Accepted
answer

Sorry pals, short tags was not active and was used in that controller. I guess thats why I got the controller code dumped as response

No one should be using short tags at first place.