cant set the select option on post

2014-10-08 Thread ajt
Hi, In cakephp I cant set the selected option on a dropdown list  when i 
post.
Wjat happens is that I select an option and Post. Then the controller will 
find the data and go back to the same page but the selected value in the 
selected list is the the default.

So I should select a date from the list, press button and be redirected to 
the same page with the selected date. That date should be selected in the 
select list. The code works but the selected option doesnt stay the same 
when the page is redirected back to the same page from the controller.


  //controller
if (isset($this->request->data['button1'])) {

$startdate=$this->request->data['Lesson']['ChooseAPaycycleStartDate'];
 $enddate=date('Y-m-d',strtotime ( +13 . ' day' , strtotime 
( $startdate)));
 $this->redirect(array('action' => 
'lesson_plan',$startdate,$enddate));
  }
/view

  echo $this->Form->create();
echo $this->Form->input('ChooseAPaycycleStartDate', 
array('options' => 
array('2014-10-06'=>'06-10-2014' , 
'2014-10-20'=>'20-10-2014', '2014-11-3'=>'3-11-2014', 
'2014-01-01'=>'01-01-2014')));
//   , 'type' => 'select', 'selected' => 2)));
 
echo $this->Form->submit('Get Lesson 
Plans',array('name'=>'button1'));  
echo $this->Form->end(); 
   


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-08 Thread euromark
Ah, i misread "last" with "latest".. :)
Well, it is the current latest, but yeah, there might still be a 2.7 
version or something, as I think most will not want to upgrade their 
(large) projects to 3.x any time soon.

Mark


Am Mittwoch, 8. Oktober 2014 13:37:57 UTC+2 schrieb Nilson Pena:
>
> YES. Cakephp 2.x rocks
>
> Em quarta-feira, 8 de outubro de 2014, mark_story  > escreveu:
>
>> 2.6.x is all that is planned for now. With that said, the door is not 
>> closed on a 2.7 if the community really wants it. If there is interest, I 
>> am happy to continue merging new backwards compatible features into 2.x to 
>> form a 2.7 release.
>>
>> -mark
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Prof. Dr. *Nilson Pena*
> Av. ACM, 585, sl. 1205
> Salvador - Bahia
> 71 - 3012-3031
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-08 Thread Nilson Pena
YES. Cakephp 2.x rocks

Em quarta-feira, 8 de outubro de 2014, mark_story 
escreveu:

> 2.6.x is all that is planned for now. With that said, the door is not
> closed on a 2.7 if the community really wants it. If there is interest, I
> am happy to continue merging new backwards compatible features into 2.x to
> form a 2.7 release.
>
> -mark
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com .
> To post to this group, send email to cake-php@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Prof. Dr. *Nilson Pena*
Av. ACM, 585, sl. 1205
Salvador - Bahia
71 - 3012-3031

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 2.5.5 and 2.6.0-beta released

2014-10-08 Thread mark_story
2.6.x is all that is planned for now. With that said, the door is not closed on 
a 2.7 if the community really wants it. If there is interest, I am happy to 
continue merging new backwards compatible features into 2.x to form a 2.7 
release.

-mark

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP and Database Cursors

2014-10-08 Thread OJ Tibi - @ojtibi
Hi again,

Assuming that in the near future, a developer might need to operate on a 
huge dataset and a batch update is out of the question, since the 
conditions of the operation is dependent on values that each record might 
have (e.g., transcribing record details into a new table for normalization 
and optimization), is there a way to access each record in a dataset using 
database cursors? Or do I have the wrong idea on how to operate on large 
datasets?

Thanks in advance.
OJ

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Best practice for changing entity in afterSave

2014-10-08 Thread Rob Cowie
OK, so I was being stupid.

I had missed adding the field to the entity $_accessible array.

I have it all working, thanks.

On Wednesday, 8 October 2014 09:15:40 UTC+1, Rob Cowie wrote:
>
> That is exactly the case. The entity returned by the save function does 
> not have the changes applied in the afterSave.
>
> I'll put an example on Github to demonstrate my problem.
>
>
>
> On Tuesday, 7 October 2014 15:20:10 UTC+1, heavyKevy wrote:
>>
>> It seems to me that the entity used to save the record in the save call 
>> is updated and available in the controller after the save call is 
>> complete...
>> Are you saying that modifications in that Entity are not showing up in 
>> the controller afterwards?
>>
>> On Monday, October 6, 2014 4:34:41 PM UTC+7, Rob Cowie wrote:
>>>
>>> Hi all, back again with another question:
>>>
>>> In our old 1.3 app, I used $this->someValue = $someData; in an afterSave 
>>> function to pass values back up to a controller.
>>>
>>> I have tried to use a $entity->set('someValue', $someData); in an 
>>> afterSave in the new cake3 table model, but this entity does not appear to 
>>> be available to me back at the controller layer. 
>>>
>>> Has any one got any pointers as to the correct way to achieve this (That 
>>> is, get a value at the controller, that has been set at the table model in 
>>> afterSave)?
>>>
>>> Thanks in advance.
>>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Best practice for changing entity in afterSave

2014-10-08 Thread Rob Cowie
That is exactly the case. The entity returned by the save function does not 
have the changes applied in the afterSave.

I'll put an example on Github to demonstrate my problem.



On Tuesday, 7 October 2014 15:20:10 UTC+1, heavyKevy wrote:
>
> It seems to me that the entity used to save the record in the save call is 
> updated and available in the controller after the save call is complete...
> Are you saying that modifications in that Entity are not showing up in the 
> controller afterwards?
>
> On Monday, October 6, 2014 4:34:41 PM UTC+7, Rob Cowie wrote:
>>
>> Hi all, back again with another question:
>>
>> In our old 1.3 app, I used $this->someValue = $someData; in an afterSave 
>> function to pass values back up to a controller.
>>
>> I have tried to use a $entity->set('someValue', $someData); in an 
>> afterSave in the new cake3 table model, but this entity does not appear to 
>> be available to me back at the controller layer. 
>>
>> Has any one got any pointers as to the correct way to achieve this (That 
>> is, get a value at the controller, that has been set at the table model in 
>> afterSave)?
>>
>> Thanks in advance.
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.