I have started building basic module but I have a doubt on controller. Please have a look at my below code and please correct me. I want to print “hello world” when I clicked on submenu of menu item.
<?php
class Shield extends oxAdminView
{
/**
* Executes parent method parent::render() and returns name of template
* file "theme.tpl".
*
* @return string
*/
public function render()
{
parent::render();
ini_set('display_errors','On');
return "shield.tpl";
}
}
Also when I tested, it is loading me, home page of website.
Which version you use? OXID5 or OXID6?
To extend the navigation controller is own solution, how does this look like?
Maybe easier is to create own menu.xml with new admin submenu item.
I am using oxid 6.0.5 and I have created menu.xml but the issue is, I am getting home page of website instead of hello world and I am not able to figure out the issue. Also in controller.php, instead of file name, I also passed ‘hello world’ in return type.
First I think your code look like OXID5, maybe you have to refactor it e.g. you use in your metadata.php version equal 2.0 and in your Shield controller you use oxAdminView I think this is your error.
Two solutions
Change your version in metadata.php to 1.0
Change your extends to \OxidEsales\Eshop\Application\Controller\Admin\AdminController and work with namespaces
I tried with your inputs and some effort from myside but still I have failed. Could you please check the below github link and correct me, where I am wrong…
This Software is the property of KMUdo AG - it is NOT Freeware.
I’m not really sure what’s going on here. For me, it looks like a module which was written for an older OXID version shall be updated. This seems to be not programmed from scratch.
Also it seems that the author of this module is somebody different than @wasim. The above entry in meteadata.php actually makes it clear that this module is not open source but under a commercial license. Did you talk to the vendor before? Are you really allowed to use it this way and to upload it in GitHub?
Please be very careful with lax handling like that. The author of the module would in doubt have any right to kick your arse
It is already bought by us and I didn`t modified it. I wanted to worked on test module. So copied the data and pasted it to test metadata file. So chill