Hi
i am currently trying to set an Array via Custom Code as var. when i print out the Array its ok but how can i access this var from another view?
Event:
Option to return VAR is set to ON
i am currently trying to set an Array via Custom Code as var. when i print out the Array its ok but how can i access this var from another view?
Event:
<h1>Select Team</h1>fn clear_years_teams_result:
{fn:read_years_teams} <!-- Gets all Teams for year x,y,z (also duplicated values if a team played in season x&z) -->
{fn:clear_years_teams_result} <!-- My Custom Function which takes the read_years_teams var and check for duplicates (code below)-->
{view:repeater_teams_in_years} <!-- Repeater which will create a Card for each team based on the return of fn clear_years_teams-->
{debug:}
Option to return VAR is set to ON
<?phpIn my Repeater i have the "data provider" Field but when i enter there {var:clear_years_teams_result} nothing happens - also debug does not show anything on the page itself?
$years_teams = $this->get("read_years_teams");
$teamlist = [ ];[li];
foreach($years_teams as $team){
if(!in_array($team['Team'], $teamlist)){
$teamlist[ ] = $team['Team'];[/li]
}
}
/* Debug:
foreach($teamlist as $element){
echo "".$element["id"]." - ".$element["name"]."<br />";
}
*/
[br]return $teamlist; // returns an Array of Associative Arrays[br][br]?>