XF 2.1 Trying to create a Php callback to template page

Wigs

Member
Hi so as the title says.

im trying to create a navigation item that calls back to a php page based on a plugin.

plugin is installed in src/addons/myplugin/item/item.php

code for item.php

Code:
namespace myplugin\item;

class item

{

  public static function getHtml(array $matches)

  {

    //

    $response->templateName = 'myplugin_item_page';

  }

}

and on the navigation settings my callback is ... myplugin\item ::getHtml

every time i click save it get the following error

Oops! We ran into some problems.
Callback myplugin\item::getHtml is invalid (error_invalid_class).

thanks in advance im sure its a simple error and im missing something
 
Hi so as the title says.

im trying to create a navigation item that calls back to a php page based on a plugin.

plugin is installed in src/addons/myplugin/item/item.php

code for item.php

Code:
namespace myplugin\item;

class item

{

  public static function getHtml(array $matches)

  {

    //

    $response->templateName = 'myplugin_item_page';

  }

}

and on the navigation settings my callback is ... myplugin\item ::getHtml

every time i click save it get the following error

Oops! We ran into some problems.
Callback myplugin\item::getHtml is invalid (error_invalid_class).

thanks in advance im sure its a simple error and im missing something
the problem is on callback you should call it myplugin\item\item::getHtml then it will work
 
@Brogan @Mike
Sorry to bother you guys but im still having issues with this callback,

the node never displays the data in the template page ive created?
 
Back
Top Bottom