Background image in CakePhp 3

0

Good!

I have a little problem, I do not understand why it happens! The issue is that each user of my system can select his wallpaper, for this I do this:

1) in Layout / default.ctp - >

background: url('<?php echo "../img/fondos/".$current_user['fondo']?>') no-repeat center center fixed;

Now that works in some pages of my system, but not in others. That's what I do not understand !!

For example In Controller / index (which actually shows Controller /) or Controller / view / 1 does not work, in others yes.

Any solution? Thanks!

    
asked by Nico 04.11.2017 в 21:29
source

1 answer

0

In cake I could solve it like this:

background: url('<?php echo $this->Url->image('fondos'.DS.$fondo)?>' )

The framework has Helpers that solve the routing, I leave information here

Greetings!

    
answered by 06.11.2017 в 16:25