Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

new controllers

  • jackyhoo
  • jackyhoo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 17 hours ago - 1 year 16 hours ago #242850 by jackyhoo
new controllers was created by jackyhoo
Please help us help you and fill where relevant:
Your LimeSurvey version:5.35
Own server or LimeSurvey hosting:
Survey theme/template:
==================
When I created a new controller file in the directory, I encountered a 404 error accessing it through routing. 


File directory:application\controllers\admin\Hjj.php

Code such as:
<?php
class Hjj extends Survey_Common_Action{
    protected function _init()
    {
            parent::_init();
    }
   public function actionIndex()
   {
echo "Helloworld";
   }
}

Url such as:
http://localhost/index.php/admin/Hjj

Later, I directly copied the existing normal controller, but changed the name and also encountered a 404 error.

How to add a new controller?
Last edit: 1 year 16 hours ago by jackyhoo.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 2 hours ago #242862 by DenisChenu
Replied by DenisChenu on topic new controllers
Controller are not in admin directory

Put in in controller directory.

And here : it's not a controller , but a PHP file
Example : gitlab.com/SondagesPro/coreAndTools/ResetPasswordController

If you want a new page for admin : use pluginhelper

$url = App()->getController()->createUrl(
'admin/pluginhelper',
array('plugin' => $this->getName(), 'sa' => 'fullpagewrapper','method' => 'actionList' )
);

Sample : gitlab.com/SondagesPro/Authentification/.../AuthRemoteToken.php

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: jackyhoo

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose