How do I?

2007-06-24 Thread Unite

Below is my controller. What I want to do is post the data from page2
to page3 using a $this->redirect(); Is this possible? Shown in BOLD in
the code is where the redirect is. Page 2 has to post to itself for
error checking but page 3 needs the post details of 2 when no errors.
Is there anyway around it without the use of sessions for example
$this->redirect(tests/page3,$this->data);? Thanks

Session->write('firstname',$this-
>data);
$this->set('myname',$this->data);
$error=false;
if(strlen($this->data['test']['surname'])==0)
$error=true;
$this->set('error',$error);
if((!$error)&&(strlen($this->data['test']
['surname'])>2)) $this->redirect('tests/page3'); //PASS $this->data to
page 3
}

function page3() {
$myfullname = $this->data['test']['name'] ."
" .$this->data['test']['surname']; //values passed from page2 when no
errors as if page2 posted directly here instead of to itself.
$this->set('fullname',$myfullname);
}
}
?>

My pages
Page1
formTag('/tests/page2','post');
echo "Name : ";
echo $html->input('test/name');
echo $html->hidden('test/surname',array('value'=>' ')); //
Hidden field from page2, has to be here else page 2 will throw up
undefined varible errors
echo $html->submit("Next",array('class'=>'btn'));
?>

Page2
formTag('/tests/page2','post');
echo "Hello " .$myname['test']['name'] .". What is ur
surname?";
echo $html->input('test/surname',array('value'=>''));
echo $html->hidden('test/name'); //Hidden field from page1,
has to be here else throw up undefined varible errors
echo $html->submit("Finish",array('class'=>'btn'));
?>
Page3



--~--~-~--~~~---~--~~
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: css error when using a controller

2007-06-24 Thread Grant Cox

So when you request www.mysite.com/whatever/index then the page does
come up ok, just all of the links to images / css are incorrect?  If
the page comes up, then your mod_rewrite must be working - so the
problem will be in the urls of the images / css themselves.  Have a
look in the source and see what urls are currently being used.


On Jun 24, 4:59 pm, zk <[EMAIL PROTECTED]> wrote:
> I apologize if this has been asked before, I searched for quite some
> time and could not locate an answer.  I'm new to cakephp and can't
> seem to get the mod_rewrite to work properly.  My pages load perfectly
> when I point towww.mysite.com, but only the content is shown if I
> point towww.mysite.com/whatever/index.  Basically, the content is
> loaded, and the default.thtml layout is loaded, but not the css or
> images that go with it.  I'm pretty sure the .htaccess files are
> correct for both the main directory, app directory, and webroot
> directory (I compared the ones on the server with a fresh unzip from
> the cakephp site).  Anybody else overcome a similar problem?  sorry
> for the beginners question!
> Cheers


--~--~-~--~~~---~--~~
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: cake.generic.css path hack

2007-06-24 Thread Grant Cox

I would recommend you do not go modifying the core like this.  If
$this->webroot is being set to an incorrect value this most likely
indicates an error in your setup and configuration - it is preferable
to find this issue and fix it than to make a change like you have.

Can you please give examples of the urls generated before and after
your modification, and any other details about your setup (folder
paths etc).


--~--~-~--~~~---~--~~
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: Frustratingly confusion with this very simple thing

2007-06-24 Thread Grant Cox

First, try a different variable name - I don't think 'error' is
predefined but it is possible.
Second, try a print_r($this->viewVars) in your view, it will show any
of the view variables that have been set by the controller.


--~--~-~--~~~---~--~~
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: Frustratingly confusion with this very simple thing

2007-06-24 Thread beetlecube

Thanks, but getting same thing.

I tried both:

$this->set('error', 0);  and
 $this->set('error', 1);   in case their was reverse logic from what
was intended.

And the IF condition is always seeing that there is an error and
displaying the message.


On Jun 24, 10:01 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> Try using 0 and 1 instead for false and true
>
> T
>
> On 6/25/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > I'm working on my User model ( I'm not using any Auth libraries or
> > anything, just doing it like the CAke blog tutorial did it ).
>
> > And I just
> > 1. Created my register.thtml file for the user.
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
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: Frustratingly confusion with this very simple thing

2007-06-24 Thread Dr. Tarique Sani
Try using 0 and 1 instead for false and true

T

On 6/25/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
>
> I'm working on my User model ( I'm not using any Auth libraries or
> anything, just doing it like the CAke blog tutorial did it ).
>
> And I just
> 1. Created my register.thtml file for the user.
>
>
-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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: Two questions: Custom form fields and IE problem.

2007-06-24 Thread Mee

Thanks )

On 24 июн, 04:03, Grant Cox <[EMAIL PROTECTED]> wrote:
> 1.  In your controller look in $this->params['form']['input_box_name']
>
> 2.  Unlikely to be a Cake issue.  Check the source and headers
> returned.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Frustratingly confusion with this very simple thing

2007-06-24 Thread beetlecube

I'm working on my User model ( I'm not using any Auth libraries or
anything, just doing it like the CAke blog tutorial did it ).

And I just
 1. Created my register.thtml file for the user.

 2. Then created the register() function in UsersController.


At this point, this function is:

 function register()
{
$this->set('error', false);
}

  And my register.thtml file is simply:


Please correct the following errors


( And a basic form to input username, password, etc.. )


According to the code above, the message:  Please correct the
following errors should *never* appear, correct?

Wel, It's always appearing and that's blowing my mind.

I'm using CAke 1.2.


  Note: -
  As far as the login function goes, for this controller,  I copied
the bulk of the login() function from the Cake blog tutorial, and when
I successfuly log in, I get successfully redirected to another page..
and I don't get any errors essages even though I have the same if/
endif code in that view file.

T.I.A.
Steve


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-06-24 Thread Jonathan Langevin
When I attempt it, I'm seeing autocomplete=off as well. What did you do to
fix this issue?

On 6/24/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
>
> Ok i have it working i made a little error :D
>
> But how can i get it to work like the example on scriptaculous:
> http://demo.script.aculo.us/ajax/autocompleter
> Here you can use the arrow buttons to select a value which is not on
> default with the helper :(
>
>
> >
>

--~--~-~--~~~---~--~~
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: Problem with created date; It is not automatically saving to db

2007-06-24 Thread Sridhar Kuppalli
Thanks a lot its working now :-)

On 6/22/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
> Well, the inbuilt behaviour is hard-coded to "created", "modified" and
> "updated".  However, you can easily throw a beforeSave() in your
> model, check if an id is already set (indicating UPDATE rather than
> INSERT) and set your data yourself.
>
> function beforeSave()
> {
> if ( empty($this->id) and
> empty($this->data[$this->name]['id']) ){
> // inserting a new row
> $this->data[$this->name]['TBP_Created_Dt'] =
> date('Y-m-d H:i:s');
> }
> $this->data[$this->name]['TBP_Modified_Dt'] = date('Y-m-d
> H:i:s');
> return parent::beforeSave();
> }
>
> This can go in a single model, or in your AppModel to apply to all.
>
>
> >
>


-- 
Thanks & Regards
Sridhar Kuppalli
Bangalore
[EMAIL PROTECTED]

"Behind Every Great Fortune There is a Crime"

--~--~-~--~~~---~--~~
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: Session expire after browser window close

2007-06-24 Thread Sergei

Yeah, I supposed that setting it to high will do the trick. But it
will be very short, so we have to increase 'CAKE_SESSION_TIMEOUT'
constant.

Thanks all.

On 25 июн, 08:09, Grant Cox <[EMAIL PROTECTED]> wrote:
> Well, I just tried it and get similar behaviour, when CAKE_SECURITY is
> set to 'low'.  The default was 'high' and I have left it like that on
> all of my projects - and this causes your session cookie to expire
> with the session (what you want) rather than some date massively in
> the future.
>


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cake.generic.css path hack

2007-06-24 Thread chanh.ong

I have an issue with cake.generic.css having a wrong path when not use
mod_rewrite and when not use the webroot in the default place that
come with the cake distro.

It tooks me several weeks pulling my hair out and finally I figure out
something.

On line 308 of cake/libs/view/helpers/html.php

This is the original line that cause the problem when not using
mod_rewrite.
//  $url = "{$this->webroot}" . (COMPRESS_CSS ? 'c' : '') . $this-
>themeWeb  . CSS_URL . $path . ".css";

This the hack that I did and the css show up correctly without
mod_rewrite
$url =  (COMPRESS_CSS ? 'c' : '') . $this->themeWeb  . CSS_URL .
$path . ".css";

I hope this will help someone sometime.

I spend a few weeks to find this!


--~--~-~--~~~---~--~~
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: Using more than one Submit button

2007-06-24 Thread Grant Cox

Hi Langdon,

I'm not really an Ajax/Javascript person either, but the way I did it
was having a javascipt function on the submit buttons themselves,
which would serialize the form data, and sent it off to server
action.  So each button has it's own javascript which includes the
submit URL - it doesn't get this from the form tag.

$("groups_process_button").onclick = function( event ){
CBAjax.get_json('/groups/process.json',
Form.serialize(Event.element(event).form),
CBGroupsAjax.process_callback);
return false;
}

this is from the javascript that attaches the events to one of our
forms - it looks for the button with id "groups_process_button", and
when this button is clicked it sends the form data to "/groups/
process", with the expectation of JSON in return.  The "return false"
is needed to ensure the normal submit button behaviour (if it is a
submit and not just a normal button) is not performed too.


--~--~-~--~~~---~--~~
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: Proper design of networks with CakePHP...

2007-06-24 Thread Grant Cox

Well, don't write the SQL yourself of course, something like

$user_story_conditions = array(
  'city_id' => $Session->read('logged_in_user_city_id')
);
$user_stories = $this->Story->findAll( array('Story'=>
$user_story_conditions) );

would be better.

For rating, the only thing that springs to mind is RosSoft's ajax
rating helper ( http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/
).


inVINCable wrote:

> That is exactly what I need to do. I want the threads selected and
> shown based upon the user's details (the user_city_id that corresponds
> to a city). So let's say I live in New York, the database will query
> for stories in New York and display them on my home page.
>
> I guess since this won't put to much stress on my server, I am going
> to go ahead and implement it today. I am just going to make a default
> view file, and write the queries for the database using things like
> (SELECT * FROM WHERE city_id=user_city_id) That way, the user gets
> only stories pertaining to his city.
>
>
> Thanks for all your help.
>
> P.S. Off topic but does anyone have any resources/ideas on designing
> an algorithm for rating? Thanks.


--~--~-~--~~~---~--~~
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: Check for value in findAllBy... function?

2007-06-24 Thread maros84

Hi,

I'm the beginner in Cake but can you try this code:

 function admin_index($id) {
 $this->Product->recursive = 0;
 $products1 = $this->Product-
>findAllByCategory_id($id);
 $this->set('products', $products1);

 if(array_key_exists('category_id',$products1)) {
 $this->data['Category']['id'] = $products1[0]
['Product']['category_id'];
 } else {
 $this->data['Category']['id'] = $id;
 }

 }

I think that $this->set function create a variable in the view and you
can't use it in the controller.

On 24 Cze, 20:02, r557 <[EMAIL PROTECTED]> wrote:
> In my function i would like to define a variable $data['Category']
> ['id'].  If the findAllByCategory_id($id) returns no records, i would
> like $this->data['Category']['id'] to be the value of the $id passed
> into the function.
>
> function admin_index($id) {
> $this->Product->recursive = 0;
> $this->set('products', 
> $this->Product->findAllByCategory_id($id));
>
> if(array_key_exists('category_id',$products)) {
> $this->data['Category']['id'] = 
> $products[0]['Product']
> ['category_id'];
> } else {
> $this->data['Category']['id'] = $id;
> }
>
> }
>
> I am getting the error: Notice: Undefined variable: products in C:
> \apache2triad\htdocs\sonsofmaxwell\new\app\controllers
> \products_controller.php on line 24 Warning: array_key_exists(): The
> second argument should be either an array or an object in C:
> \apache2triad\htdocs\sonsofmaxwell\new\app\controllers
> \products_controller.php on line 24 and line 24 would be the
> if(array_key...) line.
>
> I am wondering if i should be using afterfind in this case??  but
> never used it before, i only need this used within one function in my
> Controller.


--~--~-~--~~~---~--~~
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: Session expire after browser window close

2007-06-24 Thread Grant Cox

Well, I just tried it and get similar behaviour, when CAKE_SECURITY is
set to 'low'.  The default was 'high' and I have left it like that on
all of my projects - and this causes your session cookie to expire
with the session (what you want) rather than some date massively in
the future.


On Jun 24, 7:26 pm, Sergei <[EMAIL PROTECTED]> wrote:
> On 23 июн, 14:05, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > I'm still not understanding what the problem is.  Are you saying that:
>
> > You log into your site
> > Close your browser (all windows)
> > Load your browser again, visit your site, and you are automatically
> > STILL logged in?
>
> Yes, that's true and it sucks. This is my config:
>
> define('CAKE_SESSION_SAVE', 'php');
> define('CAKE_SECURITY', 'low');
> define('CAKE_SESSION_TIMEOUT', '120');
>
> > If this is the case, please describe what CakePHP sessions you have
> > (all the session stuff from app/config/core.php).  Also, get something
> > that will describe your browser cookies (ie the View Cookies extension
> > for firefoxhttp://www.bitstorm.org/extensions/view-cookies/), and
> > see when the site cookie is set to expire.
>
> Expires 18.01.2038 9:00 (!)
>
> So, what's the problem, how do you think?


--~--~-~--~~~---~--~~
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: Using more than one Submit button

2007-06-24 Thread Langdon Stevenson

Hi Grant

Thanks for the feedback.  Now that you mention it, I think you are right 
about AJAX submitting all buttons.

I am curious to know how you get different buttons to submit to 
different actions though.  I have tried this, but my AJAX/Javascript 
skills are a bit on the rusty side and I couln't work out how to do it. 
  If you feel like sharing your code I would be very grateful.

Regards,
Langdon


Grant Cox wrote:
> Langdon - I found that our Ajax submits were submitting ALL buttons on
> the form, but perhaps that was to do with the form serialization it
> performed.
> 
> In either case, if you've can use Javascript then I think it is much
> better to submit to different actions if you want your form to do
> different things - it's more semantically correct and can avoid the
> flakiness of detecting which button was actually clicked.
> 
> 
> On Jun 22, 12:13 pm, Langdon Stevenson <[EMAIL PROTECTED]>
> wrote:
>> The only exception to this is with an Ajax request where the button
>> name/value returned will always be the last button in the form.  This
>> has caused me no end of trouble in the past ...
>>
>> Regards,
>> Langdon
>>
> 
> 
> > 

--~--~-~--~~~---~--~~
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: horizontal form fields with css

2007-06-24 Thread trooney

You can chain together multiple classes on a single element, eg . But your question is more related to
stylesheets, rather than CakePHP. You should consult the Google oracle
for more information on CSS.

On Jun 24, 3:24 pm, Amy1234 <[EMAIL PROTECTED]> wrote:
> can I overide the  in my css class to how I want
> all my forms to be?
>
> On Jun 24, 2:27 pm, trooney <[EMAIL PROTECTED]> wrote:
>
> > Google CSS & Floats to find articles on how to dynamically position
> > elements on a page.
>
> > If you've baked your views with 1.2, your form elements are wrapped in
> >  tag. A quick and dirty method would be applying
> > the style attribute directly to the divs wrapping the title and author
> > elements, then clearing the next div element after these two.
>
> > On Jun 24, 1:26 pm, Amy1234 <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I have googled this but is unable to find out how to do this. On my
> > > forms instead of vertically listed fields such as:Title: __
> > > Author: ___
>
> > > I would like it to be: Title:    Author: 
>
> > > how would I do that.
>
> > > Thanks for your help
> > > Amy
>
> > >  "" would be the input box.


--~--~-~--~~~---~--~~
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: checkboxes 1.2

2007-06-24 Thread trooney

Try using radio inputs instead of checkboxes.

echo $html-
>radio('s_sexes',array('man'=>'Man','woman'=>'Woman','both'=>'Both');

On Jun 24, 4:35 pm, Allen Romero <[EMAIL PROTECTED]> wrote:
> Does anyone know how to display checkboxes in 1.2 then retrieve their
> values
>
> I tried something like
>
>  echo $form->checkbox('s_sexes',array('value'=>'Men')) . 'Men';
>  echo $form->checkbox('s_sexes',array('value'=>'Women')) . 'Women';
>
> but whent he page is submitted, if both are checked, only the second
> value is submitted to the page.
>
> Any examples appreciated.
>
> Thx.
>
> Allen


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Paginate define columns to use (1.2)

2007-06-24 Thread Mech7

At the moment i get 32 queries on a page which is well allot :) Is
there a way to optimize them?

I have: $this->set('articles',  $this->paginate('Article'));

And it doe queries:

1   SELECT COUNT(*) AS count FROM `cms_articles` AS `Article` WHERE 1 =
1   1   1   0
2   SELECT `Article`.`id`, `Article`.`title`, `Article`.`slug`,
`Article`.`article`, `Article`.`menu_id`, `Article`.`created`,
`Article`.`modified` FROM `cms_articles` AS `Article` WHERE 1 = 1
LIMIT 15, 1515  15  0
3   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 17 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
4   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 18 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
5   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 19 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
6   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 20 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
7   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 21 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
8   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 22 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
9   SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 23 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
10  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 24 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
11  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 25 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
12  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 26 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
13  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 27 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
14  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 28 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
15  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 29 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
16  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 30 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
17  SELECT `Tag`.`id`, `Tag`.`tag` FROM `cms_tags` AS `Tag` JOIN
`cms_articles_tags` ON (`cms_articles_tags`.`article_id` = 31 AND
`cms_articles_tags`.`tag_id` = `Tag`.`id`) WHERE 1 = 1  0   0   0
18  SELECT `Category`.`id`, `Category`.`parent_id`, `Category`.`name`
FROM `cms_categories` AS `Category` JOIN `cms_articles_categories` ON
(`cms_articles_categories`.`article_id` = 17 AND
`cms_articles_categories`.`category_id` = `Category`.`id`) WHERE 1 = 1
0   0   0
19  SELECT `Category`.`id`, `Category`.`parent_id`, `Category`.`name`
FROM `cms_categories` AS `Category` JOIN `cms_articles_categories` ON
(`cms_articles_categories`.`article_id` = 18 AND
`cms_articles_categories`.`category_id` = `Category`.`id`) WHERE 1 = 1
0   0   0
20  SELECT `Category`.`id`, `Category`.`parent_id`, `Category`.`name`
FROM `cms_categories` AS `Category` JOIN `cms_articles_categories` ON
(`cms_articles_categories`.`article_id` = 19 AND
`cms_articles_categories`.`category_id` = `Category`.`id`) WHERE 1 = 1
0   0   0
21  SELECT `Category`.`id`, `Category`.`parent_id`, `Category`.`name`
FROM `cms_categories` AS `Category` JOIN `cms_articles_categories` ON
(`cms_articles_categories`.`article_id` = 20 AND
`cms_articles_categories`.`category_id` = `Category`.`id`) WHERE 1 = 1
0   0   0
22  SELECT `Categ

checkboxes 1.2

2007-06-24 Thread Allen Romero

Does anyone know how to display checkboxes in 1.2 then retrieve their
values

I tried something like

 echo $form->checkbox('s_sexes',array('value'=>'Men')) . 'Men';
 echo $form->checkbox('s_sexes',array('value'=>'Women')) . 'Women';

but whent he page is submitted, if both are checked, only the second
value is submitted to the page.

Any examples appreciated.

Thx.

Allen


--~--~-~--~~~---~--~~
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: horizontal form fields with css

2007-06-24 Thread Amy1234

can I overide the  in my css class to how I want
all my forms to be?



On Jun 24, 2:27 pm, trooney <[EMAIL PROTECTED]> wrote:
> Google CSS & Floats to find articles on how to dynamically position
> elements on a page.
>
> If you've baked your views with 1.2, your form elements are wrapped in
>  tag. A quick and dirty method would be applying
> the style attribute directly to the divs wrapping the title and author
> elements, then clearing the next div element after these two.
>
> On Jun 24, 1:26 pm, Amy1234 <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I have googled this but is unable to find out how to do this. On my
> > forms instead of vertically listed fields such as:Title: __
> > Author: ___
>
> > I would like it to be: Title:    Author: 
>
> > how would I do that.
>
> > Thanks for your help
> > Amy
>
> >  "" would be the input box.


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-06-24 Thread Mech7

Also i would like to use the autocompleter for adding tags, so when i
press enter it will add a div with a hidden form with the tag does
anybody know how i should do this?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Check for value in findAllBy... function?

2007-06-24 Thread r557

In my function i would like to define a variable $data['Category']
['id'].  If the findAllByCategory_id($id) returns no records, i would
like $this->data['Category']['id'] to be the value of the $id passed
into the function.

function admin_index($id) {
$this->Product->recursive = 0;
$this->set('products', 
$this->Product->findAllByCategory_id($id));

if(array_key_exists('category_id',$products)) {
$this->data['Category']['id'] = $products[0]['Product']
['category_id'];
} else {
$this->data['Category']['id'] = $id;
}

}

I am getting the error: Notice: Undefined variable: products in C:
\apache2triad\htdocs\sonsofmaxwell\new\app\controllers
\products_controller.php on line 24 Warning: array_key_exists(): The
second argument should be either an array or an object in C:
\apache2triad\htdocs\sonsofmaxwell\new\app\controllers
\products_controller.php on line 24 and line 24 would be the
if(array_key...) line.

I am wondering if i should be using afterfind in this case??  but
never used it before, i only need this used within one function in my
Controller.


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-06-24 Thread Mech7

Ok i have it working i made a little error :D

But how can i get it to work like the example on scriptaculous:
http://demo.script.aculo.us/ajax/autocompleter
Here you can use the arrow buttons to select a value which is not on
default with the helper :(


--~--~-~--~~~---~--~~
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: horizontal form fields with css

2007-06-24 Thread trooney

Google CSS & Floats to find articles on how to dynamically position
elements on a page.

If you've baked your views with 1.2, your form elements are wrapped in
 tag. A quick and dirty method would be applying
the style attribute directly to the divs wrapping the title and author
elements, then clearing the next div element after these two.

On Jun 24, 1:26 pm, Amy1234 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have googled this but is unable to find out how to do this. On my
> forms instead of vertically listed fields such as:Title: __
> Author: ___
>
> I would like it to be: Title:    Author: 
>
> how would I do that.
>
> Thanks for your help
> Amy
>
>  "" would be the input box.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



horizontal form fields with css

2007-06-24 Thread Amy1234

Hello,

I have googled this but is unable to find out how to do this. On my
forms instead of vertically listed fields such as:Title: __
Author: ___

I would like it to be: Title:    Author: 

how would I do that.

Thanks for your help
Amy

 "" would be the input box.


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-06-24 Thread Mech7

Yes that is the article i used.. but it seems that in 1.2 the
component is not needed anymore?
http://api.cakephp.org/1.2/class_ajax_helper.html#e5f03710a3e8295419dc5f99bdef4dea

But does nobody have any examples for 1.2 that i can look at as i
can't get it working.. It does post requests but the response seems to
be the view it is used in?


--~--~-~--~~~---~--~~
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: dukudu.de made with CakePHP

2007-06-24 Thread Jonathan Langevin
sharp looking site, shame it's in german :-)

On 6/24/07, xhoch2 <[EMAIL PROTECTED]> wrote:
>
>
> Maybe this is interesting for someone.
> Dukudu.de - a german twitter clone - was made with CakePHP.
> The service was mentioned on TechCrunch because it is listed for sale
> on ebay:
> http://feeds.feedburner.com/~r/Techcrunch/~3/126640006/
>
> In my opinion a very good reference for CakePHP.
>
> http://www.dukudu.de/
>
>
> >
>

--~--~-~--~~~---~--~~
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: paginator->numbers - problem with ajax ...

2007-06-24 Thread Mariano Iglesias

Please ticket this:

https://trac.cakephp.org

Thanks!

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de puatki
Enviado el: Domingo, 24 de Junio de 2007 10:22 a.m.
Para: Cake PHP
Asunto: paginator->numbers - problem with ajax ...

echo $paginator->numbers(array('url'=> array('controller'=>'Projects',
'action'=>'sort'),'update'=>'list'));

I get 1


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



dukudu.de made with CakePHP

2007-06-24 Thread xhoch2

Maybe this is interesting for someone.
Dukudu.de - a german twitter clone - was made with CakePHP.
The service was mentioned on TechCrunch because it is listed for sale
on ebay:
http://feeds.feedburner.com/~r/Techcrunch/~3/126640006/

In my opinion a very good reference for CakePHP.

http://www.dukudu.de/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



css error when using a controller

2007-06-24 Thread zk

I apologize if this has been asked before, I searched for quite some
time and could not locate an answer.  I'm new to cakephp and can't
seem to get the mod_rewrite to work properly.  My pages load perfectly
when I point to www.mysite.com, but only the content is shown if I
point to www.mysite.com/whatever/index.  Basically, the content is
loaded, and the default.thtml layout is loaded, but not the css or
images that go with it.  I'm pretty sure the .htaccess files are
correct for both the main directory, app directory, and webroot
directory (I compared the ones on the server with a fresh unzip from
the cakephp site).  Anybody else overcome a similar problem?  sorry
for the beginners question!
Cheers


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



paginator->numbers - problem with ajax ...

2007-06-24 Thread puatki

Hello ... ;)

I have problem with $paginator->numbers.
When I execute code:

$paginator->sort('TOPIC', 'topic', array('url'=>
array('controller'=>'Projects', 'action'=>'sort'),'update'=>'list'));
everything works ok and my site use ajax.

When I try do the same with $paginator->numbers

echo $paginator->numbers(array('url'=> array('controller'=>'Projects',
'action'=>'sort'),'update'=>'list'));

I get 1
instead of sth like:

( ... ) 

Re: Dynamic Sidebar

2007-06-24 Thread AD7six



On Jun 24, 4:26 am, Contrid <[EMAIL PROTECTED]> wrote:
> I have found the beforeRender() function.
> I think this is what I need.

http://groups.google.com/group/cake-php/web/frequent-discussions


--~--~-~--~~~---~--~~
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: Mystery, Edit action changes to Add action when validation fails...

2007-06-24 Thread oleonav

Ok, that makes sense.

On Jun 23, 1:05 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 6/23/07, oleonav <[EMAIL PROTECTED]> wrote:
>
>
>
> > Nevertheless one would expect that Cake should output the right form
> > tag when a validation error is found.
>
> You are trying to fight cake instead of relishing it - the convention states
> that if an ID field is found then edit action is presumed for the POSTed
> form else an add  action is presumed.
>
> But don't worry - keep at it and you will soon develop a taste for it - it
> is a lot like Tofu ;)
>
> HTH
> Tarique
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
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: Session changes

2007-06-24 Thread BoSc

Ah... that clarifies things, thx Grant Cox.

Changing the favicon.ico  solved the problem!

On Jun 24, 10:03 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> No, it's not a bug, it's just something to keep in mind with any web
> application that uses pretty urls made to look like a folder structure
> (iehttp://localhost/controller/action/params).  The whole point is
> to make the user, your browser, and Google think that these are an
> actual folder structure (as people are used to the idea of
> categorising with folders, not so much with underscores or hyphens).
> So when you have a relative link, of course your browser assumes that
> it is relative to this pseudo folder, not realising (or caring) that
> by requestinghttp://localhost/controller/action/params/yourimage.jpg
> it is going to execute your controller action again.
>
> It's just one of those things you have to be careful of :)


--~--~-~--~~~---~--~~
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: Session expire after browser window close

2007-06-24 Thread Sergei



On 23 июн, 14:05, Grant Cox <[EMAIL PROTECTED]> wrote:
> I'm still not understanding what the problem is.  Are you saying that:
>
> You log into your site
> Close your browser (all windows)
> Load your browser again, visit your site, and you are automatically
> STILL logged in?


Yes, that's true and it sucks. This is my config:

define('CAKE_SESSION_SAVE', 'php');
define('CAKE_SECURITY', 'low');
define('CAKE_SESSION_TIMEOUT', '120');



> If this is the case, please describe what CakePHP sessions you have
> (all the session stuff from app/config/core.php).  Also, get something
> that will describe your browser cookies (ie the View Cookies extension
> for firefoxhttp://www.bitstorm.org/extensions/view-cookies/), and
> see when the site cookie is set to expire.


Expires 18.01.2038 9:00 (!)

So, what's the problem, how do you think?


--~--~-~--~~~---~--~~
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: Dynamic Sidebar

2007-06-24 Thread kabturek

Hi
> turns cakephp into a proper cms
omg im SO afraid ;)
greets,
On Jun 24, 4:34 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> so are you using beforeRender to pull your data as needed, to populate the
> sidebar "elements"? i'd be interested in seeing how someone turns cakephp
> into a proper cms, with dynamic side columns, dynamic templates, template
> editing (looked like davidicus cms had that one solved), easy-to-add
> modules/components, etc
>
> On 6/23/07, Contrid <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have found the beforeRender() function.
> > I think this is what I need.
>
> > On Jun 24, 3:56 am, Contrid <[EMAIL PROTECTED]> wrote:
> > > Sorry if I'm not being clear...
>
> > > Say for instance I have a layout like this :
>
> > > http://www.w3.org/1999/xhtml";>
> > > 
> > > 
> > > 
> > > 
>
> > > 
>
> > > 
>
> > > 
> > > 
>
> > > ...where $sidebar needs to have dynamic content.
> > > It should also be global...visible on all pages of a specific layout.
> > > How will I go about this?
>
> > > I'm not sure if elements are only for static content.
>
> > > On Jun 24, 3:16 am, Contrid <[EMAIL PROTECTED]> wrote:
>
> > > > I have discovered the "views/elements" folder. This already helps
> > > > alot.
> > > > I created a file named "sidebar.thtml" in the "elements" folder.
> > > > Now...I need to somehow parse data to the "sidebar" view.
>
> > > > On Jun 24, 3:13 am, Contrid <[EMAIL PROTECTED]> wrote:
>
> > > > > Good day,
>
> > > > > I started reading through the CakePHP manual and stuff today.
> > > > > I'm new to MVC and this is the first time I work with it. Please
> > bare
> > > > > with me.
>
> > > > > In my default layout ("layouts/default.thtml") I want to have a
> > > > > dynamic sidebar which comes consists of data coming from the
> > database.
> > > > > For example...it could be an array, each key being an array with an
> > ID
> > > > > and a Title.
>
> > > > > How will I go about creating a dynamic sidebar?
> > > > > Do I create a controller for it, or how?
>
> > > > > Thank you for your help.
>
> > > On Jun 24, 3:16 am, Contrid <[EMAIL PROTECTED]> wrote:
>
> > > > I have discovered the "views/elements" folder. This already helps
> > > > alot.
> > > > I created a file named "sidebar.thtml" in the "elements" folder.
> > > > Now...I need to somehow parse data to the "sidebar" view.
>
> > > > On Jun 24, 3:13 am, Contrid <[EMAIL PROTECTED]> wrote:
>
> > > > > Good day,
>
> > > > > I started reading through the CakePHP manual and stuff today.
> > > > > I'm new to MVC and this is the first time I work with it. Please
> > bare
> > > > > with me.
>
> > > > > In my default layout ("layouts/default.thtml") I want to have a
> > > > > dynamic sidebar which comes consists of data coming from the
> > database.
> > > > > For example...it could be an array, each key being an array with an
> > ID
> > > > > and a Title.
>
> > > > > How will I go about creating a dynamic sidebar?
> > > > > Do I create a controller for it, or how?
>
> > > > > Thank you for your help.


--~--~-~--~~~---~--~~
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: Session changes

2007-06-24 Thread Grant Cox

No, it's not a bug, it's just something to keep in mind with any web
application that uses pretty urls made to look like a folder structure
(ie http://localhost/controller/action/params ).  The whole point is
to make the user, your browser, and Google think that these are an
actual folder structure (as people are used to the idea of
categorising with folders, not so much with underscores or hyphens).
So when you have a relative link, of course your browser assumes that
it is relative to this pseudo folder, not realising (or caring) that
by requesting http://localhost/controller/action/params/yourimage.jpg
it is going to execute your controller action again.

It's just one of those things you have to be careful of :)


--~--~-~--~~~---~--~~
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: Proper design of networks with CakePHP...

2007-06-24 Thread Grant Cox

> Although, I will have variables in the user file
> for things like "show thread where user_location_id=city_id"

Do you mean that the controller action will need to retrieve database
information (ie posts, news articles, threads) based upon the current
user's details (ie location)?  This should be done with a single query
where possible (not endless if statements with slightly different
queries) - as it is easier to maintain.

I wouldn't worry about performance for select queries (even with
joins), you will be able to have several hundred per page request with
little performance hit (selects are very fast).  And you can always
look at caching if things do get slow.


--~--~-~--~~~---~--~~
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: Session changes

2007-06-24 Thread BoSc

Ok, thx all, I understand now that other things are also relevant to
check when dealing with sessions. Later this day I'll try to check all
my images. I just tried a small test with 2 new actions that only
respectively set a session_VAR + redirect, and die/print_r the
Session. This seems to work, so the problem has to be somewhere else.
I do think that this is kind of a strange behaviour, certainly not
intuitive. No View related stuff should screw up my Controller's
behaviour, agree? That's part of the whole point using a MVC for
starters... Hey, but I still love Cake, only wondering wether this
could be considered a bug?

On Jun 24, 3:20 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> If you refer to a file that does not exist in your webroot, then cake
> assumes it is a controller action and runs it through the dispatcher.
> So requesting /img/image_that_exists.jpg will return "/app/webroot/img/
> image_that_exists.jpg", whereas requesting /img/nonexistant_image.jpg
> will attempt to run the ImgController::nonexistant_image action (and
> will give a "Missing controller" error if your DEBUG > 1, 404
> otherwise).
>
> In both of your cases, the problem will be a relative image path being
> used.  So if you are in the /users/index action and have an image link
> to "img/something.jpg", the browser will see this as /users/index/img/
> something.jpg - and this will run through your /users/index action
> again.
>
> The solution - don't use relative images, and try to always use the
> Html Helper.  With the favicon - check in your layout as sometimes
> there is a favicon link in the  tags, and for some reason this
> will currently have a relative path (it shouldn't).
>
> And finally, BoSc, I didn't reply to your original query because it
> was too verbose, and in the 30 seconds I gave it I couldn't understand
> your problem.  Your reply to John was much more succinct :P


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---