How to use new image folder in cakephp

I created a folder in app/webroot/. for posting images. eralier default img folder cantain image. which I used something like this:

<?php 
   echo $html->image('foldopen.png',array('width'=>14,'height'=>'10','alt'=>'open'));
?>

Now I created a new folder with the img folder. how to use it?

+3
source share
5 answers

use a slash at the beginning of the path. for instance

echo $html->image('/images/foldopen.png');

Using a slash at the beginning relative to the app / webroot directory

+9
source

Just create your folder in the webroot (test) folder and use it like this:

echo $this->Html->image('/test/image.jpg');
+4
source

webroot.

$this->Html->image('../images/profile_image.jpg');

cakephp2.1. .

+2

App.imageBaseUrl app/Config/core.php

+1

If you want your $ html-> image () instructions to be short and change the default image path, you can always override the default behavior for the image () by changing the config / tags.php file.

more information on changing tag output

0
source

Source: https://habr.com/ru/post/1745549/


All Articles