Access helper functions from the root directory of Limesurvey

Mehr
4 Jahre 6 Tage her - 4 Jahre 6 Tage her #102389 von utsi
utsi erstellte das Thema 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
Letzte Änderung: 4 Jahre 6 Tage her von utsi.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 6 Tage her - 4 Jahre 6 Tage her #102396 von utsi
utsi antwortete auf das Thema: 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 :(
Letzte Änderung: 4 Jahre 6 Tage her von utsi.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 3 Tage her #102469 von DenisChenu
DenisChenu antwortete auf das Thema: 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 .

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha