Is it possible to change image folder in cakephp 2.4 -


i have read many docs, failed solve problem: images in existing project stored in $_server['document_root'].'/media/' want, can't change in cakephp 2.4 default image folder $_server['document_root'].'/app/webroot/img/' desire.

lib/cake/bootstrap.php contains constants:

/**  * path public images directory.  */ if (!defined('images')) {     define('images', www_root . 'img' . ds); }  /**  * web path public images directory.  */ if (!defined('images_url')) {     define('images_url', 'img/'); } 

and

configure::write('app.imagebaseurl', images_url); 

i tried change:

images $_server['document_root'].'/media/'  images_url / 

and doesn't work @ all. image files still points $_server['document_root'].'/app/webroot/img/' see when try render image in view:

echo $this->html->image('/img/ride_scheme/chema.jpg', array( 'width' => 300 )); 

if created in app/webroot/img/ride_scheme image file chema.jpg rendered, changed folder in images constant in lib/cake/bootstrap.php !!!

in documentation see:

constants images_url, js_url, css_url have been deprecated , replaced config vari- ables app.imagebaseurl, app.jsbaseurl, app.cssbaseurl respectively.
constants images, js, css have been deprecated.

i gues problem.

please, show me how change image folder

according description, reckon images_url should media/ , not /.

alternatively, add rewriterule .htaccess (in project root) rewrite media folder (assuming have apache web server rewrite module enabled):

rewriterule ^app/webroot/img/(.*) /media/$1 

or create symbolic link links img/ folder media folder (assuming you're on linux hosting , have ssh/shell access server):

cd app/webroot rm -rf img/ ln -s ../../media img 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -