Highcharts and Cakephp and Mysql

2014-07-26 Thread ANDRIUN SANTACRUZ
help

Highcharts graphs with cakephp and managing database with mysql 

thank you

http://www.highcharts.com/

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

2014-07-26 Thread Engleang Sam
Dear All,

I have problem with saving image that upload from IOS objective C. My 
friend does it with AFnetworking , framework of objective-c while I could 
not find any files to save in Cakephp. Any solution or comment would be 
appreciated!

Best regard,

Engleang

-- 
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: testAction returns null after redirect

2014-07-26 Thread euromark
http://stackoverflow.com/questions/24964348/cakephp-testaction-returns-null-after-redirect


Am Samstag, 26. Juli 2014 11:45:45 UTC+2 schrieb walter:
>
> I test a controller action. I pass data to it via the POST method. After 
> saving a data into DB I do a redirect to a main page where I display a 
> message about of action result.
>
> I want to test whether this behavior and text of the message equal to 
> expected, but I get a null instead of the $this->contents value.
>
> Yet, all data saved and messages displayed successfully via the browser.
>
> Below is my call of a testAction
>
> $res = $this->testAction('/ask', array_merge(array('return' => 'contents'), 
> array('data' => $fields_data, 'method' => 'post')));
>
>

-- 
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: testAction returns null after redirect

2014-07-26 Thread euromark
Of course the result is null when the response only contains the redirect 
headers.
You can read those headers - including the session value stored in your 
test method.

See $this->headers['Location'] and CakeSession::read('message') or sth

mark


Am Samstag, 26. Juli 2014 11:45:45 UTC+2 schrieb walter:
>
> I test a controller action. I pass data to it via the POST method. After 
> saving a data into DB I do a redirect to a main page where I display a 
> message about of action result.
>
> I want to test whether this behavior and text of the message equal to 
> expected, but I get a null instead of the $this->contents value.
>
> Yet, all data saved and messages displayed successfully via the browser.
>
> Below is my call of a testAction
>
> $res = $this->testAction('/ask', array_merge(array('return' => 'contents'), 
> array('data' => $fields_data, 'method' => 'post')));
>
>

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


testAction returns null after redirect

2014-07-26 Thread walter
I test a controller action. I pass data to it via the POST method. After 
saving a data into DB I do a redirect to a main page where I display a 
message about of action result.

I want to test whether this behavior and text of the message equal to 
expected, but I get a null instead of the $this->contents value.

Yet, all data saved and messages displayed successfully via the browser.

Below is my call of a testAction

$res = $this->testAction('/ask', array_merge(array('return' => 'contents'), 
array('data' => $fields_data, 'method' => 'post')));

-- 
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: Behavior method won't work

2014-07-26 Thread Stephen S
Here's the link to the hasField method I forgot to paste
http://api.cakephp.org/2.4/class-Model.html#_hasField

So just to elaborate, in AppModel::beforeDelete() I check if the deleted
field exists, if so I update the deleted field and return false. Otherwise
I return true and let CakePHP do its thing.


On 26 July 2014 10:22, Stephen S  wrote:

> If you want to do this with a behavior then you should look at the
> beforeDelete callback, you can update your field within this callback and
> then return false to automatically abort the delete (as per the book).
>
>
> http://book.cakephp.org/2.0/en/models/behaviors.html#ModelBehavior::beforeDelete
>
> You could also just write something like this in your AppModel to make it
> apply to all models, my applications use $this->hasField('deleted') to see
> if soft delete is supported with the model.
>
>
>
> On 26 July 2014 09:22, Sam Clauw  wrote:
>
>> I'll try to write my very first behavior that does a soft delete instead
>> of a hard delete. I've expanded my model with
>>
>> public $actsAs = array('SoftDelete');
>>
>>
>> and I've created the behavior "SoftDeleteBehavior.php" in
>> App/Model/Behavior:
>>
>>
>>
>>> >> App::uses('ModelBehavior', 'Model');
>>> class SoftDeleteBehavior extends ModelBehavior
>>> {
>>> function setup(Model $Model, $settings = array())
>>> {
>>>
>>> }
>>>
>>> function delete(Model $Model, $id = null)
>>> {
>>> $Model->id = $id;
>>>
>>> if ($Model->saveField('deleted', date('Y-m-d H:i:s'))) {
>>> return true;
>>> }
>>> return false;
>>> }
>>> }
>>
>>
>> However, when I try to delete something, the delete() method from my
>> behavior doesn't overwrite the normal one. What could cause this issue?
>>
>> --
>> 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.
>>
>
>
>
> --
> Kind Regards
>  Stephen Speakman
>



-- 
Kind Regards
 Stephen Speakman

-- 
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: Behavior method won't work

2014-07-26 Thread Stephen S
If you want to do this with a behavior then you should look at the
beforeDelete callback, you can update your field within this callback and
then return false to automatically abort the delete (as per the book).

http://book.cakephp.org/2.0/en/models/behaviors.html#ModelBehavior::beforeDelete

You could also just write something like this in your AppModel to make it
apply to all models, my applications use $this->hasField('deleted') to see
if soft delete is supported with the model.



On 26 July 2014 09:22, Sam Clauw  wrote:

> I'll try to write my very first behavior that does a soft delete instead
> of a hard delete. I've expanded my model with
>
> public $actsAs = array('SoftDelete');
>
>
> and I've created the behavior "SoftDeleteBehavior.php" in
> App/Model/Behavior:
>
>
>
>> > App::uses('ModelBehavior', 'Model');
>> class SoftDeleteBehavior extends ModelBehavior
>> {
>> function setup(Model $Model, $settings = array())
>> {
>>
>> }
>>
>> function delete(Model $Model, $id = null)
>> {
>> $Model->id = $id;
>>
>> if ($Model->saveField('deleted', date('Y-m-d H:i:s'))) {
>> return true;
>> }
>> return false;
>> }
>> }
>
>
> However, when I try to delete something, the delete() method from my
> behavior doesn't overwrite the normal one. What could cause this issue?
>
> --
> 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.
>



-- 
Kind Regards
 Stephen Speakman

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


Behavior method won't work

2014-07-26 Thread Sam Clauw
I'll try to write my very first behavior that does a soft delete instead of 
a hard delete. I've expanded my model with

public $actsAs = array('SoftDelete');


and I've created the behavior "SoftDeleteBehavior.php" in 
App/Model/Behavior:

 

>  App::uses('ModelBehavior', 'Model');
> class SoftDeleteBehavior extends ModelBehavior
> {
> function setup(Model $Model, $settings = array())
> {
> 
> }
> 
> function delete(Model $Model, $id = null)
> {
> $Model->id = $id;
> 
> if ($Model->saveField('deleted', date('Y-m-d H:i:s'))) {
> return true;
> }
> return false;
> }
> }


However, when I try to delete something, the delete() method from my 
behavior doesn't overwrite the normal one. What could cause this issue?

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