ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Module return array

January 07, 2013 5:56pm

Subscribe [1]
  • #1 / Jan 07, 2013 5:56pm

    jp555soul

    3 posts

    So Im returning an array of all the information I need from my function, but I can seem to figure out how to parse through the array once I get to the templete.

    Module:

    Class main{
         function data(){
              blah blah blah 
              return $array;
         }
    }

    Template:

    {exp:main:data}{data}{/exp:main:data}

    {data} returns “Array”

    How can I parse through this in EE code or is there another to parse this variable?

    Thanks

  • #2 / Jan 08, 2013 2:18pm

    jp555soul

    3 posts

    I have changed the code some and getting a slightly better result but still not receiving the request data.

    Module:

    Class main{
         function data(){
              blah blah blah 
              $this->return_user(14);
         }
    
         function return_user($var){
              return ''.$var.'';
         }
    }

    Template:

    {exp:main:data}{exp:main:return_user}{/exp:main:data}

    {exp:main:return_user} returns

    but not
    14

    .

    Any ideas?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases