Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOLVED Hand over array to another component
#1
Hello,

I've got 2 components and I call get_component('b') within component a.
Component b, creates an array, i.e. $features.

Now, I want to use the array $features in component a.

How can I do that? The debug says that $features in component "a" is not defined.
Setting the array to global $features = array(); didn't work.
I defined the code in component b a function (like "function xy()"), that returns the array, but since I have to call the component several times, I got an error, that I can not call the function again (function gets executed only once, then not more).

What am I doing wrong?
If I copy the whole code of component "b" into component "a", everything works fine.
However, I'd rather split things up in different components but have no idea how to "communicate" between them.

I'd be glad if somebody could help me cause I haven't found any solutions while searching the forums.
Thank you very much in advance.
Shasaar
Reply


Messages In This Thread
Hand over array to another component - by Shasaar - 2017-08-15, 06:29:57



Users browsing this thread: 1 Guest(s)