Re: $this-action = images ??

2007-07-30 Thread starkey

THANK YOU!



On Jul 30, 12:08 am, Grant Cox [EMAIL PROTECTED] wrote:
 Or, are you referring to any images in your view that have a relative
 path (and you aren't using the HTML helper image() function)?

 If you view localhost/users/index, and there is a relative image
 images/yourimage.jpg, then your browser will actually request
 localhost/users/images/yourimage.jpg.  This is why you should always
 use a full path, or preferably use the HTML helper image() function,
 which does this for you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



$this-action = images ??

2007-07-29 Thread starkey

Sorry, I'm such a noob and I'm swimming through batter.

I'm getting a weird action... After my expected action runs, I get a
second action of 'images' for some weird reason (I have no idea).  My
process is really simple (no components, vendors, elements, etc).

Basically, I have this in a controller:

function beforeFilter()
{
   $actionCheck;

   if (!$this-Session-check('Username'))
   {
  $this-Session-write('Username', 'Anon');
   }

   switch($this-action)
   {
  case 'view':
  case 'vote':
$actionCheck= null;
break;
  default:
$actionCheck= 'update';
break;
   }

   if (!empty($action))
   {
  $this-access = @$this-Acl-check($this-Session-
read('Username'), $this-name, $actionCheck);
   }
   else
   {
  $this-access = true;
   }

   if (!$this-access)
   {
  if ('Anon' != $this-Session-read('Username'))
  {
 $this-redirect('/login/denied');
  }
  else {
 $this-Session-write('next_page','/'.$this-name.'/'.
$this-action);
 $this-redirect('/login');
  }
  die();
   }

}

The first time through $this-action is 'view' or some other expected
action.  Then (after my action completes) it will run again with the
action of 'images'.  In other words, if I set a breakpoint on the
switch in this controller it will hit that breakpoint twice, the first
with the expected action and the second with action set to 'images.'

Any ideas?  Is this the expected operation of Cake?

Thanks,
Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $this-action = images ??

2007-07-29 Thread Grant Cox

Or, are you referring to any images in your view that have a relative
path (and you aren't using the HTML helper image() function)?

If you view localhost/users/index, and there is a relative image
images/yourimage.jpg, then your browser will actually request
localhost/users/images/yourimage.jpg.  This is why you should always
use a full path, or preferably use the HTML helper image() function,
which does this for you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---