Invalid argument supplied for foreach() when generating link
- ydenda
- Member | 21
Hello together,
What am I missing?
when I attempt to produce the account activation link in presenter:
or in template:
TRACY complains on
/nette/application/src/Application/UI/Presenter.php:1143
with warning: Invalid argument supplied for foreach()
First I thought the problem could be I haven't used FQDN on my test bench to reach the web app, nevertheless even after change to FQDN, I got the same error.
Unfortunately I cannot show you the TRACY output, since currently I have unsupported php version on production site.
Ubuntu 16/04, Apache 2.4.18, php 7.0, Nette 2.4
- ydenda
- Member | 21
I tried to isolate the problem a bit more…
When I place following code:
in renderDefault method, the link is successfully generated.
Problem occurs, when I place the line in some other method. For better imagination, please see the code of corresponding presenter:
Does anyone have an idea what I've done wrong?
- ydenda
- Member | 21
Well, I made things working a bit.
After some time I've found article Link generation in emails with Nette 2.3
So I created /app/model/MailManager.php with following content:
It made the {link} working in the template, nevertheless $this->link is
not available.
For my needs it is sufficient so far.
Thank you guys for spent effort trying to help me.
Hope this helps others…