Page 1 of 1

Read previous assigned array in custom function

Posted: Sun May 22, 2016 12:49 pm
by AccentAvondschool
Hi,

I'm using holidays plugin ...

Code: Select all

{holidays year={$currentyear}}
Works great,

Code: Select all

{$holidays|print_r}
in GCB results in ...

Code: Select all

Array ( [2016-01-01] => Nieuwjaarsdag [2016-01-06] => Driekoningen [2016-02-14] => Valentijnsdag [2016-03-25] => Goede Vrijdag [2016-03-27] => 1e Paasdag [2016-03-28] => 2e Paasdag [2016-04-27] => Koningsdag [2016-5-5] => Bevrijdingsdag [2016-05-05] => Hemelvaartsdag [2016-05-15] => 1e Pinksterdag [2016-05-16] => 2e Pinksterdag [2016-05-08] => Moederdag [2016-06-19] => Vaderdag [2016-10-04] => Dierendag [2016-11-11] => Sint Maarten [2016-12-05] => Sinterklaas [2016-12-25] => 1e Kerstdag [2016-12-26] => 2e Kerstdag [2016-12-31] => Oudjaarsdag ) 1  
Now I like to use this array (assigned as $holidays) in my own custom function ...

Code: Select all

{get_startdays year={$currentyear}}
Or maybe better, call the holiday function in my own custom function. I know that array(s) can't be passed.

I've tried the eval but no luck :(

Re: Read previous assigned array in custom function

Posted: Mon May 23, 2016 7:30 am
by AccentAvondschool
I found it myself, it is so obvious ...

Code: Select all

{get_startdays year="{$currentyear}" holidays="{$holidays|@serialize}"}
Thanks for your patience with this CMSMS newbie