Access helper functions from the root directory of Limesurvey

Plus d'informations
il y a 4 ans 7 mois - il y a 4 ans 7 mois #102389 par utsi
utsi a créé le sujet : Access helper functions from the root directory of Limesurvey
Hi. I'm looking to access SPSSFieldMap() and createFieldMap() functions contained within the "export_helper.php" and "common_helper.php" files.

The problem I'm facing is I'm not able to figure out how to include them in a file which is placed in the root directory and not inside the "application" folder.

I want to give a URL to someone (let's say it's www.abcd.com/view.php ) and in this view.php, I need to access those two functions. I do have Limesurvey installed on www.abcd.com and need a way to be able to access those helper functions from view.php.

I hope my post made sense. Let me know if something in unclear.

Thanks.

EDIT:
My directory structure is something like this:
abcde/
  application/
     controllers/
         AllController.php
     views/
         all/
            view_view.php
  framework/
  .
  .

AllController.php
class AllController extends CController 
{
    public function actionIndex()
    {
	$aData = 'why';
	$this->render('all/view', $aData);
    }
}

view_view.php
echo $aData; // getting undefined variable on running this page
Dernière édition: il y a 4 ans 7 mois par utsi.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 7 mois - il y a 4 ans 7 mois #102396 par utsi
utsi a répondu au sujet : Access helper functions from the root directory of Limesurvey
I did figure out the solution to a part of the problem; i.e. undefined variable issue . I was passing and accessing the data in a wrong way. The correct way was:

Passing Data
public function actionIndex()
{
   $aData['var1'] = 'Value 1';
   $this->render('all/view', $aData);
}

Reading Data
echo $var1; // prints Value 1

Accessing the helper functions is still a mystery to me at the moment :(
Dernière édition: il y a 4 ans 7 mois par utsi.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 7 mois #102469 par DenisChenu
DenisChenu a répondu au sujet : Access helper functions from the root directory of Limesurvey
Hi,

You can add your own controllers in application/controllers directory.
After if you set your ocntrollers name to TestController, you can acces it with url
example.org/test , or example.org/index.php?r=test (i think for the second way, didn't test).

In your controller, you can use Yii->app(), and the call your helper.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!