Wednesday, October 31, 2012

cakephp with jquery datatable

iI am using jquery datatable. successfully ..
but the data show a maximum of 100 rows.. anybody can share to me??

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: ajax link with unique ID

Except the ajax helper is deprecated....

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 21:17:31, Chris <chris69m@yahoo.com> wrote:

THANKS Chetan,... you are the MAN ! 
it works,... 

On Wednesday, October 31, 2012 11:07:05 AM UTC-7, chetan varshney wrote:
Why are you php tag inside php tag??

use it as-

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => "friend_".$friend['FriendRequest']['id']));?>

On Wed, Oct 31, 2012 at 11:11 PM, Chris <chri...@yahoo.com> wrote:

hi guys,... I'm having a problem placing unique ID in a ajax link 'update': 

'update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>' 

here is the link: 

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>')
); 
?>




I'm getting an error no matter what I do by placing in echo '(',  ')' , <?php echo ($friend['FriendRequest']['id']) ?>    ....
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

can anyone help please,...? 

thanks in advance 
chris


--
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 post to this group, send email to cake...@googlegroups.com.
To unsubscribe from this group, send email to cake-php+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

xml tag with one attribute and one value

Hello ... and thank you so very much for assisting!

The core libraries > utilities > xml documentation seems to imply that I can return the value of a tag's text by using '@' as the key. See following, straight from the documentation:

===============================

<?php
$xmlArray = array(
    'project' => array(
        '@id' => 1,
        'name' => 'Name of project, as tag',
        '@' => 'Value of project'
    )
);
$xmlObject = Xml::fromArray($xmlArray);
$xmlString = $xmlObject->asXML();
The content of $xmlString will be:

<?php
<?xml version="1.0"?>
<project id="1">Value of project<name>Name of project, as tag</name></project>

===============================

This is definitely what I would like to do, but whenever I use '@' as a key, I get a major page full of errors.

I would like to return something like: <project id="1">Value of project</project> (with no child tags)

In fact, and this is probably a different issue, I would really like to return: 

<projects>
<project id="1">Value of project</project>
<project id="2">Value of project</project>
<project id="3">Value of project</project>
<project id="4">Value of project</project>
</projects>

Again, thank you!!!

Kevin

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: ajax link with unique ID

THANKS Chetan,... you are the MAN ! 
it works,... 

On Wednesday, October 31, 2012 11:07:05 AM UTC-7, chetan varshney wrote:
Why are you php tag inside php tag??

use it as-

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => "friend_".$friend['FriendRequest']['id']));?>

On Wed, Oct 31, 2012 at 11:11 PM, Chris <chri...@yahoo.com> wrote:

hi guys,... I'm having a problem placing unique ID in a ajax link 'update': 

'update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>' 

here is the link: 

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>')
); 
?>




I'm getting an error no matter what I do by placing in echo '(',  ')' , <?php echo ($friend['FriendRequest']['id']) ?>    ....
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

can anyone help please,...? 

thanks in advance 
chris

--
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 post to this group, send email to cake...@googlegroups.com.
To unsubscribe from this group, send email to cake-php+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: ajax link with unique ID

Why are you php tag inside php tag??

use it as-

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => "friend_".$friend['FriendRequest']['id']));?>

On Wed, Oct 31, 2012 at 11:11 PM, Chris <chris69m@yahoo.com> wrote:

hi guys,... I'm having a problem placing unique ID in a ajax link 'update': 

'update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>' 

here is the link: 

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>')
); 
?>




I'm getting an error no matter what I do by placing in echo '(',  ')' , <?php echo ($friend['FriendRequest']['id']) ?>    ....
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

can anyone help please,...? 

thanks in advance 
chris

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

ajax link with unique ID


hi guys,... I'm having a problem placing unique ID in a ajax link 'update': 

'update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>' 

here is the link: 

<?php echo $ajax->link(ucfirst(__('accept', true)), array('controller' => 'friends', 'action' => 'accept', $friend['FriendRequest']['id']), array('update' => 'friend_<?php echo $friend['FriendRequest']['id'] ?>')
); 
?>




I'm getting an error no matter what I do by placing in echo '(',  ')' , <?php echo ($friend['FriendRequest']['id']) ?>    ....
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xachkaa/hamayk.com/html/app/views/friends/requests.ctp on line 83

can anyone help please,...? 

thanks in advance 
chris

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: JQuery save success/error

Here's how I resolved this. The save function now always returns a json array, so I have a result key that contains success/error. If success, I run a second ajax function that pulls back the element as html and updates the dom. If failure, I parse the 'errors' key of the json response and display them.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 15:36:54, Jonathan Sundquist <jsundquist@gmail.com> wrote:

Is your goal to output some message if they have successfully filled out your form and possibly add a little extra data to the success message?  If so just hide the success message by default, add some selectors that you can populate with the json that's returned on success, and then show the message.

As far as the failure is concerned again have hidden elements on the form that you can select and add the validation messages to.  Or there are also plenty of jQuery validation plugins out there that you could do your validation on the fly using onBlur or onFocus for that matter.


On Wed, Oct 31, 2012 at 10:33 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Completely - but how do I render the element as json? As soon as I do $this->render('/elements/whatever'); it's returned as straightforward html.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 15:28:01, Tilen Majerle <tilen.majerle@gmail.com> wrote:

in both cases return json value and have keys eg. "success" (true/false) and "data". If "success" == true, just "print" data, if "success" == false, than use data as json, and decode that string and print validation errors, or generate string in controller for errors and print it..understand ?
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns <jeremyburns@classoutfit.com>
Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: How to?

CLOSED
public_html/index.php
if (!defined('ROOT')) {
define('ROOT', DS . 'FULL_PATH_TO_DOMAIN');
}
if (!defined('APP_DIR')) {
define('APP_DIR', 'CAKE_APP_DIR');
}
//
CAKE APP DIR:
remove index.php and .htaccess

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: using SSL login leads to 404 Error

Could you paste full error ?

change function forceSSL() to function forceSSL($type) and pr($type)

that will show you some info

On Sunday, April 15, 2012 9:05:09 PM UTC+8, luftlinie wrote:
hi everyone,

i want to secure the login with SSL and use the Security Component for
that. cake seems to swith to HTTPS
but has trouble calling the new URL

https://server/users/login

giving me a 404 error. I understand this is fixable with $this-
>Security->blackHoleCallback????
but how? what am i doing wrong?

CODE: controller users
================================
    function beforeFilter()
    {

            $this->Security->blackHoleCallback = 'forceSSL';
            $this->Security->requireSecure('login');

                   parent::beforeFilter();
                $this->Auth->allow('*');

    }



    function forceSSL()
    {
                $this->log('Redirecting user from HTTP to HTTPS', 'https');
            $this->redirect('https://' . $_SERVER['SERVER_NAME'] . $this-
>here);

        }

================================

appreciate your help. thanks a lot :)

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: JQuery save success/error

Is your goal to output some message if they have successfully filled out your form and possibly add a little extra data to the success message?  If so just hide the success message by default, add some selectors that you can populate with the json that's returned on success, and then show the message.

As far as the failure is concerned again have hidden elements on the form that you can select and add the validation messages to.  Or there are also plenty of jQuery validation plugins out there that you could do your validation on the fly using onBlur or onFocus for that matter.


On Wed, Oct 31, 2012 at 10:33 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Completely - but how do I render the element as json? As soon as I do $this->render('/elements/whatever'); it's returned as straightforward html.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 15:28:01, Tilen Majerle <tilen.majerle@gmail.com> wrote:

in both cases return json value and have keys eg. "success" (true/false) and "data". If "success" == true, just "print" data, if "success" == false, than use data as json, and decode that string and print validation errors, or generate string in controller for errors and print it..understand ?
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns <jeremyburns@classoutfit.com>
Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: JQuery save success/error

render your template with $this->render(); and pass variables to it, than here just print json_encode($variable); :)
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com>
Completely - but how do I render the element as json? As soon as I do $this->render('/elements/whatever'); it's returned as straightforward html.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 15:28:01, Tilen Majerle <tilen.majerle@gmail.com> wrote:

in both cases return json value and have keys eg. "success" (true/false) and "data". If "success" == true, just "print" data, if "success" == false, than use data as json, and decode that string and print validation errors, or generate string in controller for errors and print it..understand ?
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns <jeremyburns@classoutfit.com>
Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: JQuery save success/error

Completely - but how do I render the element as json? As soon as I do $this->render('/elements/whatever'); it's returned as straightforward html.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2012, at 15:28:01, Tilen Majerle <tilen.majerle@gmail.com> wrote:

in both cases return json value and have keys eg. "success" (true/false) and "data". If "success" == true, just "print" data, if "success" == false, than use data as json, and decode that string and print validation errors, or generate string in controller for errors and print it..understand ?
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns <jeremyburns@classoutfit.com>
Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: JQuery save success/error

in both cases return json value and have keys eg. "success" (true/false) and "data". If "success" == true, just "print" data, if "success" == false, than use data as json, and decode that string and print validation errors, or generate string in controller for errors and print it..understand ?
--
Lep pozdrav, Tilen Majerle



2012/10/31 Jeremy Burns <jeremyburns@classoutfit.com>
Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

JQuery save success/error

Not an expert at jQuery, but getting there.

I'm submitting data to a controller function that saves a record via ajax. If the save works, I'm rendering an element, which then appears back in the ajax form as html ready to be placed into a dom element. All good - that works fine. But if the save fails I want to return an array that includes the validation errors - that really ought to be json. So on success I want html, on error I want json - and I can't have both.

How do I either (i) render the element but have it returned as json (and ideally tack in a 'success' key that I can check in the jQuery) or (ii) otherwise determine the success/error state when html has been returned to the jQuery?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: How to?

you need to change incldue path look at book.cakephp.com

and if i'm right you want to "hide" files from public so nobody can see them. That's why cake uses .htaccess files ;)

--
Lep pozdrav, Tilen Majerle



2012/10/31 Piotr Beschel <piotr.beschel@gmail.com>
How to move cake app outside public_html
folders
- public_html:
--webroot files here
-Controller
-Model
- rest of Cake App Structure

??


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

How to?

How to move cake app outside public_html
folders
domain.com:
- public_html:
--webroot files here
-Controller
-Model
- rest of Cake App Structure

??


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

CakePHP 2 with normal Form Authentication + Basic for API access

I simply can't wrap my head around how this is supposed to work.
I'm trying to create two separate logins. One for admin which is a normal 'Form' authentication with all rights to alter/delete data, and one 'Basic' authentication for model 'Account' which will have some allowed methods. No matter what I do, I allways get a 302 response with redirect to /users/admin/login, and never a Basic Authentication dialog. 

Is it really not possible to do this with the Auth Component?

Response from curl (tried a random url which should require authentication):

$curl -H "Accept:Application/json" http://localhost:8888/myproject/admin/users/index.json -v 

< HTTP/1.1 302 Found
< Date: Wed, 31 Oct 2012 12:38:55 GMT
< Server: Apache
< X-Powered-By: PHP/5.3.6
< Set-Cookie: CAKEPHP=a621801575312e3b56d2c670d314547d; expires=Wed, 31-Oct-2012 16:38:55 GMT; path=/; HttpOnly
< Location: http://localhost:8888/myproject/admin/users/login
< Content-Length: 0
< Content-Type: application/json
* Connection #0 to host localhost left intact
* Closing connection #0



My AppController so far:

<?php

App::uses('Controller', 'Controller');

class AppController extends Controller
{

    public $components = array(
        'Session',
        'RequestHandler',
        'Auth',
    );

    public function beforeFilter()
    {
        parent::beforeFilter();

        if ($this->params['ext'] == 'json') {
            $this->Auth->authenticate = array(
                'Basic' => array(
                    'userModel' => 'Account',
                    'fields' => array('username' => 'facebook_id', 'password' => 'facebook_token'),
                ),
            );
        } else {
            $this->Auth->authenticate = array('Form');
        }
    }

    public function isAuthorized($user)
    {
        return true;
    }

}

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Tuesday, October 30, 2012

Override UsersController method

Hi,

I'm new to CakePHP and I have searched Google (and this group) but couldn't find information about this. I'm modifying an application and wanted to override the index() method in app/Controller/UsersController.php. I'm trying to make this as modular as possible so I'm creating a plugin (app/Plugin/MyPlugin/Controller/MyPluginController.php, How do I go about doing this? a link or response would be appreciated. Thanks.

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: Error Debugging Help

hi, 

I am new to setup files on server, I am using ubuntu server, it's showing ImgController error, can you please give me detail idea, how can i solve this error

can you give me all steps, how to check web server configuration, what changes I have made there?

Thank you. 

On Friday, 4 November 2011 09:51:57 UTC+5:30, zuha wrote:
It sure doesn't seem right to throw a missing controller error for a a missing image call.  Does anyone else have an idea about how to find where this exception is being thrown?   Or what CakeRequest is asking for which causes this exception? 

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

regarding RTf to HTML conversion in cakephp

Hi i have rtf documents and i want to convert content of  rtf document  in to html using cakephp or php class 

 i have already try class rtf of php and it dose n't seems to work for me.


Please help.

Thanks 
Vaibhav Pathak

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: CakePHP 2.x implement edit form in ajax in a popup

Hi,

You are use facebox jquery this is very nice....

On Wednesday, October 3, 2012 10:00:22 AM UTC-4, Kiran wrote:
I have read other posts and searched google before posting this here.

I have a jquery popup in a view where I intend to show EDIT form and then submit using ajax.

Further Details

There is a reservation controller. reservations on a particular date are shown in the index ctp in a table . When user clicks on edit button a div pops up. Now I need to show Edit form and submit it via Ajax. 

Please can somebody point me in the right direction , may be some help or some tutorial.

Thanks in advance,
Kiran

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: Error: Index.phpController could not be found

What URL are you typing to get that error?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Oct 2012, at 11:22:40, Babulal Saini <saini.babulal@logicspice.com> wrote:

Hi, 

<?php

class IndexController extends AppController {

}

you are use this code...




On Wednesday, February 22, 2012 6:46:08 PM UTC-5, amg55nj wrote:

Completely new to CakePHP. Tried doing a search with no results.

I installed CakePHP to my localhost Apache directory. Other programs such as PHPMyAdmin work just fine. I am getting this error:

Missing Controller

Error: Index.phpController could not be found.

Error: Create the class Index.phpController below in file: app\Controller\Index.phpController.php

<?php

class Index.phpController extends AppController {

}

Notice: If you want to customize this error message, create app\View\Errors\missing_controller.ctp


What do I do? I tried creating that PHP file and putting it in the app\Controller directory but that did not work.


--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: Error: Index.phpController could not be found

Hi, 

<?php

class IndexController extends AppController {

}

you are use this code...




On Wednesday, February 22, 2012 6:46:08 PM UTC-5, amg55nj wrote:

Completely new to CakePHP. Tried doing a search with no results.

I installed CakePHP to my localhost Apache directory. Other programs such as PHPMyAdmin work just fine. I am getting this error:

Missing Controller

Error: Index.phpController could not be found.

Error: Create the class Index.phpController below in file: app\Controller\Index.phpController.php

<?php

class Index.phpController extends AppController {

}

Notice: If you want to customize this error message, create app\View\Errors\missing_controller.ctp


What do I do? I tried creating that PHP file and putting it in the app\Controller directory but that did not work.

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: form value in cake 1.3


Hey you are use $this->User->save($this->data);
That is very nice



On Tuesday, October 9, 2012 3:19:34 PM UTC-4, Chris wrote:
hi guys,... I'm in cake 1.3,... please help,... 
I can't read form value from inplace editor in a controller,... any other approch,...? 

     $user['User']['short_status'] = $this->params['form']['value'];

      $this->User->save($user);
      echo $user['User']['short_status'];
      die(); 

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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: How to read an item from an array

Hello... you are get your project title   $title = $this->Project->field('title',array('condition'=>'condition'));



On Thursday, October 18, 2012 5:12:42 AM UTC-4, Cody Sortore wrote:
Okay, I'm a bit of a noob, but I've been messing with this all night and cannot figure it out.  I've had this problem before, but just figured out what my problem is, and although this particular issue isn't pressing, because I plan to use a similar item in the future I would like to understand what I'm missing here.

I'm looking for a way to read a single item from the database, I can pass it to the view rather easily, but reading it in the same controller is confounding me.

I've tried:

$title = $this->Project->read('title');
$title = $this->Project->find('first', array('fields' => array('Project.title'), 'conditions' => array('Project.id' => $id)));
$title = $this->Project->query("SELECT `title` FROM `Projects` WHERE `id`=$id");

All I'm trying to do is display a message that says "Hey you deleted this project" later I have

$this->Session->setFlash(__("Project $title deleted"));

However, when the message flashes all I see "Project Array deleted" with all three examples.  I understand what it's doing... I just don't understand why... how do I select the actual "title" from the array, instead of the entire array?

Using CakePHP 2.x if it makes a difference in this instance.

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: Error: Call to a member function find() on a non-object

Hello Russell Brown,

          You are use this code so this error not show again. Please add this code "

<?php
class AddressesController extends AppController {
  var $name = 'addresses';
  var $uses = array('Address');
  
 function index($id = null) {
    $this->set('address_list', $this->Address->find('all'));
  }

}
?>

"         

On Monday, October 15, 2012 7:58:52 PM UTC-4, Russell Brown wrote:
Error:  Call to a member function find() on a non-object
File:  c:\wamp\www\cake222\app\Controller\AddressesController.php

I get the error on the $this->set('address_list', $this->Address->find('all')) line below:

Partial listing of my AddressesController file:

<?php
class AddressesController extends AppController {
  var $name = 'addresses';
  
 function index($id = null) {
    $this->set('address_list', $this->Address->find('all'));
  }

I have a controller called AddressesController.php.  I have a Model called Address.php.  The table is called addresses.

I am using Cake 2.2.2 and PHP 5.3.8 and Apache 2.2.21 and MySQL 5.5.16

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: Paginate with associated model conditions

I am also facing the same issue.
The pagination works well if I unbind all the models and if I bind some models then even find query is working fine but not with 'count(*)' query in pagination. Kindly help.


On Monday, July 9, 2012 12:14:25 AM UTC+5:30, Michael wrote:
No on knows how to solve this issue? I have a few very complicated work arounds, but every time I end up implementing such work arounds, it always comes back to the fact that I was doing it wrong originally. 

~Michael

On Fri, Jul 6, 2012 at 12:09 AM, Michael Gaiser <mjga...@gmail.com> wrote:
So I am having some issues getting Paginate to recognize its associated models when handling its conditions. Some events have a location_id, but others (like the feeding event) have their location id specified in the associated model. From the Events Index page I want to do a search for all events that have the location_id = 87. Heres my setup.

Event hasMany Feeding (EventsFeeding table)

$conditions['OR'] = array(
'Event.location_id'=>87,
'Feeding.location_id'=>87,
);


$this->paginate = array(
'limit'=>$count,
'contain' =>array(
'Feeding'=>array('id', 'event_id', 'location_id'),
),
'fields'=>array('id', 'event_type_id', 'location_id', 'start_date', 'end_date', 'created', 'modified'),
'order'=>array('Event.start_date ASC')
);

$events = $this->paginate($conditions);


This is the error I get:
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Feeding.event_id' in 'field list'


I have looked around, some solutions I have found try to make use of a fake hasOne bind, others try to setup a virtual field others play around with the 'joins' array. I have tried all of these but cannot seem to get them to work. Any help would be greatly appreciated.

~Michael

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Monday, October 29, 2012

unlink error from FileEngine when many requests happen frequently

I get an error like:

warning: unlink(/.../tmp/cache/models/myapp_cake_model_default_something): No such file or directory in /.../lib/Cake/Cache/Engine/FileEngine.php on line 247

This happen when I have 3 JSON requests happen at close to the same time. My guess is that the cache has removed the file in one thread and then the other thread tries to remove it, but it has already been removed.

I think I'm using cake php 2.2 but the version.txt file says 2.1. Any chance this is fixed in 2.3?

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: CakePHP 1.3 and AMFPHP

https://github.com/dhagan/cake2-amfphp

On Sunday, April 10, 2011 8:15:34 PM UTC-7, sams wrote:
there is this article
http://bakery.cakephp.org/articles/vernerd/2009/06/28/flex-remoting-with-cakephp-cpamf-plugin-1

in the comments someone says it works well with 1.3 when changing routes

 - S




On 10 April 2011 06:58, R0ckET <leohi...@gmail.com> wrote:
I found only one plugin that list was last updated in 2008

On 10 abr, 02:53, Ryan Schmidt <google-2...@ryandesign.com> wrote:
> On Apr 10, 2011, at 00:45, R0ckET wrote:
>
> > hello, someone has used AMFPHP with cakephp 1.3?
>
> Did you try Google? There appear to be several results.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Testing database connection on the fly

Hi, I'm trying to perform a button in one of my views where a user (an admin) can perform a database connection test on the fly, I have an action where I have the following code and I get the error "Database connection "Sqlserver" is missing, or could not be created."

The thing is that I don't want to assign that connection to a model ($useDbConfig), I just want to test the given config parameters. Can somebody help me please? I'm with Cake 2.2.3 and a working MSSQL implementation. Thanks in advance

public function testconnection() {
$this->layout = false;
// Connection settings
$conn = 'test';
$config = array();
$config['datasource'] = 'Database/Sqlserver';
$config['persistent'] = false;
$config['host'] = $this->request->data['DbServer'];
$config['login'] = $this->request->data['DbUser'];
$config['password'] = $this->request->data['DbPassword'];
$config['database'] = $this->request->data['DbName'];
if (isset($this->request->data['DbPort'])) {
$config['port'] = $this->request->data['DbPort'];
} else {
$config['port'] = 1433;
}
// connects to database
App::import('Model', 'ConnectionManager');
try {
$connected = ConnectionManager::create($conn, $config);
} catch (Exception $connectionError) {
$connected = false;
}
if ($connected && $connected->isConnected()) {
$this->set('res', 1);
} else {
$this->set('res', $connectionError->getMessage());
}
ConnectionManager::drop($conn);
}

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

Re: HABTM and user login

That's what I've done in the past when I want to include data that
Auth doesn't automatically store. IIRC, you can write to the Auth.User
key; the data will then be available from the user() method.

$this->Session->write('Auth.User.group', $group_data);

Retrieve with $this->Auth->user('group')

On Fri, Oct 26, 2012 at 5:45 AM, Álvaro G. Vicario
<alvaro@demogracia.com> wrote:
> I have a User model to use built-in authentication. The model has several
> $hasOne relationships and all linked models get saved automatically into
> session, which is great because I can call AuthComponent::user() whenever I
> need to perform an action based on user data.
>
> Now, I've added a $hasAndBelongsToMany relationship to indicate that a user
> can belong to zero or more groups. However, information about the Group
> model doesn't show up anywhere in the Auth component. I can definitively
> perform a manual User->find() and groups will be there but
> AuthComponent::user() does not contain group information. I've tried
> everything I could think of, including the contain option. I know I'm using
> contain right because it makes valid models appear and it complains for
> non-existant models, but Group is simply ignored.
>
> In the end I had to write a hack in my login function: make a manual find()
> and incorporate the 'Group' key to session data.
>
> Is this a known limitation?
>
> --
> 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 post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

--
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.