| CakePHP Official Site · Rules and Regulations |
Help
Search
Members
Calendar
Shoutbox
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| peterhufo |
Posted: Apr 7 2011, 09:14 PM
|
|
Newbie ![]() Group: Members Posts: 3 Member No.: 2775 Joined: 7-April 11 |
This code:
<?php echo $html->image('XXX-(white).png', array('alt' => 'XXX', 'height' => '50px', 'width' => '100px' ) ); ?> produces: <img src="/XXXadmin/img/'XXX-(white).png" alt="LBM" height="50px" width="100px" /> which does not find the image: http://localhost/XXXadmin/app/webroot/img/XXX-(white).png. The web page at http://localhost/XXXadmin/ is found but the $html->css() and $html->image() functions do not find the files. Mac 10.6.6, CakePHP 1.3.8 Help! |
| peterhufo |
Posted: Apr 7 2011, 10:19 PM
|
|
Newbie ![]() Group: Members Posts: 3 Member No.: 2775 Joined: 7-April 11 |
Well, this may be a browser problem. It works in FireFox 3.6.6 and Safari 3.2 but not in FF 4, safari 5.0 or Chrome 10.0.
Update later. |
| peterhufo |
Posted: Apr 7 2011, 11:36 PM
|
|
Newbie ![]() Group: Members Posts: 3 Member No.: 2775 Joined: 7-April 11 |
These work.
Add this before the image name in the image() function "/app/webroot/img/" Add this before the css name in the css() function /app/webroot/css/" AND add the extension ".css" to the file name. I suspect that this is mentioned somewhere in the CakePHP documents. I am in a hurry to finish phase 1 of a project and the answer was not easy to find in the documentation. ALSO, I had parentheses around part of the image name. That's a NO-NO! Replaced them with "%28" and "%29". |
| Oldskool |
Posted: Apr 8 2011, 07:48 AM
|
||
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 46 Member No.: 2748 Joined: 23-March 11 |
You are still using CakePHP 1.2 syntax, try:
|
||
![]() |
![]() ![]() ![]() |