Friday, October 30, 2009

cookie data corrupted

Hi,

I try to get cookies to work. I try to store data the usual way

$cookie['username'] = $this->data['User']['username'];
$cookie['password'] = $this->data['User']['password'];
$this->Cookie->write('Auth.User',$cookie,true, '+2 weeks');

when I retrieve the cookie data with

$cookie = $this->Cookie->read('Auth.User');
debug($cookie);

the data is always corrupted.

Array
(
[Auth] => Array
(
[User] => ��
)

)

There is no difference whether I switch off encryption of the cookie
data, by setting the third value of Cookie->write to false. Any ideas,
what I am missing?

Cheers,
tobi_one
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Containable behaviour doesn't return all data

Hi
I use containable behaviour, but I don't get all data that I have
requested
My code is :

$options['fields'] = array('User.*');
$options['conditions'] = array('User.username' => $user_id);
$options['contain'] = array(
'Organization' => array(
'fields'=>array('Team.*'),
'User' => array(
'fields' => array('User.*')
)
)
);
pr($this->User->find('first',$options));

But I get only :

Array
(
[User] => Array
(
[id] => 1
.......
.......
)

[Team] => Array
(
[0] => Array
(
[id] => 4
.......
.......
[UsersTeams] => Array
(
[id] => 1
[user_id] => 1
[team_id] => 4
)
)
)
)

I don't get all users that are inside team

Between User and Team there is a hasAndBelongsToMany relation.

How can I do to get also all users that are in team?

Many Thanks
Marco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

> So I am once again looking for good hosting that is inexpensive and
> doesn't have all the limitations and frustrations that come with
> shared hosting.
>
> Who do you guys use?

I like Slicehost
https://manage.slicehost.com/customers/new?referrer=72080a7f7a6ddeeda018ddbb61e630a3
and Bytemark (uk)

j

--
jon bennett - www.jben.net - blog.jben.net

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

Re: Cake Hosting - Who is the best?

I use MediaTemple. www.mediatemple.net. Have for years and the
customer support is amazing.

On Oct 29, 10:44 pm, TimG <t...@gurske.com> wrote:
> I know this isn't a cake question but I respect the cake community
> more than anybody so I wanted to ask you guys.
>
> I was using a VPS at hostmysite for $36 a month. It was nice because
> it was cheap, linux based, speedy and allowed me to do what I needed
> to do like up the php memory limits for resizing images and such.
> SHared hosting usually is too darn restrictive... especially is you
> want to install a plugin or something. Unfortunately they got rid of
> that server option and replaced it with one that is five times the
> price.
>
> So I am once again looking for good hosting that is inexpensive and
> doesn't have all the limitations and frustrations that come with
> shared hosting.
>
> Who do you guys use?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

not getting belongsTo objects

hi- i am so close on this one....

Imagine three models...Event , Venue, and EventType. Currently, Event
belongsTo Venue. Each event has a specific venue at which it will
occur. If i nav to events/view/2, i get the expected Event object and
it's Venue object. Great.

It makes since in my mind that each EventType hasMany Event(s). If i
nav to types/view/2, again, i get the correct Event(s) associated to
that EventType.

My problem is, when i pull a specific EventType, i don't get the venue
object associated to the Event object. I get the related events, but i
had hoped the Venue for which that Event occurs would also be bound to
that specific Event. I am not sure what code you will need, but i can
give anything...we can start with the Model for Type, and Event


//Type Model
<?php

class Type extends AppModel {
var $name = 'Type';
var $hasMany = array(
"Event"=>array(
"foreignKey"=>"event_type",
"order"=>array("date"=>"asc","start_time"=>"asc")
)
);
}

?>

//EVENT model
<?php

class Event extends AppModel {
var $name = 'Event';

var $belongsTo=array(
"Venue"=>array(
"foreignKey"=>"venue"
),
"Type"=>array(
"foreignKey"=>"event_type"
)
);
}

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

Re: time duration

Try changing options to:
'options' => array('timeFormat' => '24')

Enjoy,
John

On Oct 30, 11:36 am, Jiru <jiransl...@gmail.com> wrote:
> Hello, here is the code  file: add.ctp
>
> div class="trainingCourses form">
> <?php echo $form->create('TrainingCourse');?>
>  <fieldset>
>    <legend><?php __('Add TrainingCourse');?></legend>
>  <?php
>   echo $form->input('course_code');
>   echo $form->input('name');
>   echo $form->input('training_type_id');
>   echo $form->input('Duration',array('training_courses.time', 'type'
> => 'time', 'interval' => 15 , 'empty' => ' ','options' => array
> ('hh','mm')));
>   echo $form->input('course_sequence');
>   echo $form->input('comments');
>  ?>
>
>  </fieldset>
> <?php echo $form->end('Submit');?>
> </div>
>
> On Oct 30, 1:23 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Please show the code with what you are trying to accomplish, so that
> > we may better be able to help you!
> > Enjoy,
> >    John
>
> > On Oct 30, 9:19 am, Jiru <jiransl...@gmail.com> wrote:
>
> > > Even though tried to change the options the hh/mm option is not
> > > available.
>
> > > On Oct 30, 11:09 am, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > > Please read the cook book!
>
> > > >http://book.cakephp.org/view/189/Automagic-Form-Elements#options-time...
>
> > > > Enjoy,
> > > >    John
>
> > > > On Oct 30, 8:00 am, Jiru <jiransl...@gmail.com> wrote:
>
> > > > > Hi,
> > > > >        I have atimefield in the form. In the combo box it have
> > > > > meridians[am/pm].
> > > > > As I wantdurationI need hh/mm instead of am/pm in the drop
> > > > > down.Please give suggessions for this.
> > > > >                                     Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: HABTM query - count number of related entries

What are the field names of the related fields? I.e. Tag.? ==
Stories_tags.? == Story.?

On Oct 30, 7:24 am, Daniel <theworldof...@gmail.com> wrote:
> Hi. I've got two models, Tag and Story, each with a HABTM relation
> with each other (joined via a stories_tags table).
>
> What I'm looking for is the ability to do a find('all') on the Tag
> model, and within the results have a count of all the stories that are
> related to each tag.
>
> Is this possible to do? Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---