Closed mhunesi closed 1 year ago
I dont understand what command you try to execute? Anyhow desired in LUYA is to use the commands folder. What should the other Controller do? What class do you extend from?
When I execute controllers/SettingsController Link: http://localhost/en/admin#!/default/5/mymoduleadmin/settings/index
mymoduleadmin has controllers/SettingsController and commands/SettingsController
controllers/SettingsController
namespace app\modules\mymodule\admin\controllers;
class SettingsController extends luya\admin\base\Controller {
public function actionIndex()
{
return $this->render('index', [
'data' => [], // Data to assign into the view file `index`.
]);
}
}
commands/SettingsController
namespace app\modules\mymodule\admin\commands;
class SettingsController extends \luya\console\Command {
public function actionIndex()
{
return $this->outputSuccess('Action successfully done');
}
}
Thanks.
So to understand that correctly: You are trying to access the class SettingsController extends luya\admin\base\Controller
with mymoduleadmin/settings/index
but it seems to run the SettingsController extends \luya\console\Command
which of course throws the exception from above? Is that the problem?
So i can not use tablePrefix in database. Can you check it?. in file \luyadev\luya-module-admin\src\models\UserGroup.php
, line 29 should use{{%admin_user_group}}
instead of admin_user_group
Thank you
Hi @bee1194 i don't think this has something to do with the topic, but yes you are right. We should fix that. could you send me a PR or create an issue? Thanks
So to understand that correctly: You are trying to access the
class SettingsController extends luya\admin\base\Controller
withmymoduleadmin/settings/index
but it seems to run theSettingsController extends \luya\console\Command
which of course throws the exception from above? Is that the problem?
Yes. luya-core/console/Controller.php class throws the exception.
@mhunesi so the web request http://localhost/en/admin#!/default/5/mymoduleadmin/settings/index
runs the console command? is that your problem? sorry for the delay
I am going to close this issue because:
If you think this is still important or there are more/new informations. Please reopen the issue and let us know.
If this is a problem or a feature you like to discuss, join our discussion: LUYA discussions. We try to keep our issue tracker as clean as possible in order to focus on active issues.
What steps will reproduce the problem?
I have two controllers;
What is the expected result?
The console controller can only run within a console Application context.
What do you get instead? (A Screenshot can help us a lot!)
LUYA Check ouput (run this script and post the result: luyacheck.php)
This not working on nginx.
Additional infos