Using a session variable in a latte file
- kc2scy
- Member | 22
Hello,
I need to capture the user who log in email address and I like to display on
my home page.
so when the user log in I wrote it to a session variable like below:
if I did this correctly I thought I could access it this way:
however I get a error :
I thought that the $container was singleton so I didn't have to declare
it?
any help would be great.
Thanks
Mike
Last edited by kc2scy (2014-02-02 01:54)
- kc2scy
- Member | 22
Hello Patrik,
Thanks it worked with a simple presenter but when I added it to a presenter
with a form I got stuck.
What I have is a name of a image in my database and I'm trying to pass back the
path to where the image is. I wanted it to be display on the same template as
the form.
What I have is this:
Template:
**
Presenter:**
Last edited by kc2scy (2014-02-04 06:01)
- llsm
- Member | 121
try this without dot in the start of path (that makes path relative to index root, not your current location):
If it doesnt work, just find the correct path using your browser, this code
should create path http://<your domain whatever it is>/images/<passed
id>/<imageName>
Is image extension part of name? dont forget about extension…
- Pavel Macháň
- Member | 282
Or use some service for image path
Example:
Config
Presenter
Or latte version
OR use Nette object
Last edited by EIFEL (2014-02-04 11:47)
- kc2scy
- Member | 22
llsm wrote:
try this without dot in the start of path (that makes path relative to index root, not your current location):
If it doesnt work, just find the correct path using your browser, this code should create path http://<your domain whatever it is>/images/<passed id>/<imageName>
Is image extension part of name? dont forget about extension…
What happing is, in my templete I'm getting a error saying the variable don't exist (“variable profilePic don't exsist”). I should have been more clear on what my issue was thanks again for looking
Last edited by kc2scy (2014-02-04 16:31)