2

In my main controller I followed the instructions in the Controller documentation and I have the following meta data:

@:route(GET, "/about/*")
var aboutController:AboutController;

Then in my AboutController file I have:

package controller;

import api.TestApi;
import api.PortfolioItem;
using ufront.MVC;
using ufront.web.result.AddClientActionResult;

class AboutController extends Controller
{


    @:route(GET, "/graphicDesign")

    public function graphicDesign()
    {
        //      return new PartialViewResult({… etcetera

    }


}

When I visit the /about/graphicDesign path in my browser, the PHP server generates an error:

PHP Fatal error:  Call to a member function execute() on null in /Users/allan/Documents/Freelance/Confidant/Website/3d confidant site/ufront/www/lib/controller/HomeController.class.php on line 70

The PHP lines 69-71 have:

    public function execute_aboutController() {
    return $this->context->injector->_instantiate(_hx_qtype("controller.AboutController"))->execute();
}

So, do I need different syntax so that the controller instantiates properly?

Confidant
  • 356
  • 1
  • 9
  • It appears that this issue is unique to PHP, as the subcontroller works fine when using neko server. I suspect this is also unique to Haxe 3.4+, per the other issue here: https://stackoverflow.com/questions/45599210/how-can-i-ensure-a-php-class-is-found-when-compiling-haxe – Confidant Feb 07 '18 at 22:54

1 Answers1

0

fyi i upgraded to 3.4 i don't have the same issues. yes remoting does not work but only when targeting php7 . in fact even when not targeting php7 and running in a php7 apache environment doesn't work either. also in works with Mamp & php 5.6.

i had no probs with sub controllers though. my answer is . did you try on another php environment ?

postite
  • 133
  • 6
  • Thanks—I am now working on other things but I will try that in future. I was using PHP 5.6.10. Should I try 5.6.32 perhaps? – Confidant Mar 13 '18 at 15:09