Override Core Controller By Package Is Not Working

Permalink 1 user found helpful
Hi community!

Here's situation :

Hi I'm trying to override by package like this :

public function on_start() {
$objEnv = Environment::get();
$objEnv->overrideCoreByPackage('single_pages/dashboard/users/search.php', $this);
$objEnv->overrideCoreByPackage('controllers/single_page/dashboard/users/search.php', $this);
}

For the file 'single pages' is working...but file 'controllers' it not working...Any ideas?

Your help is very much appreciated.

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi nasir88,

I have never used this feature before, but would also be interested in the right way to use it.
WebcentricLtd replied on at Permalink Reply
hi, what does your folder structure look like in your package?
Are your namespaces correct? Please post back if you work out what the issue is.
nasir88 replied on at Permalink Reply
Hi AndyJ,

I Copy from
'\concrete\controllers\single_page\dashboard\users\search.php'
to my folder structure package
'\packages\override_core\controllers\single_page\dashboard\users\search.php'.

in my packages (search.php) :-

namespace Packages\OverrideCore\Controllers\SinglePage\Dashboard\Users;
use \Concrete\Core\Page\Controller\DashboardPageController;
class Search extends DashboardPageController {  
   public function mymethod() {
   }
}
WebcentricLtd replied on at Permalink Reply
Hi,
how about if you change the namespace in the controller to:

*edited*
namespace Concrete\Package\OverrideCore\Controller\SinglePage\Dashboard\Users;
?
nasir88 replied on at Permalink Reply
it's still not working. Maybe i'm missing something?
WebcentricLtd replied on at Permalink Reply
sorry - I don't know. Did you try installing the package afresh?
nasir88 replied on at Permalink Reply
After Re-Install my package is still not working.
Its ok Andy J. Thanks for helping me.