Wednesday, April 30, 2014

Re: 3.0 - How to print/debug from Controller like Cake 2.xx

debug is set to true by default. i did var_dump but nothing happens.


On Thu, May 1, 2014 at 12:37 AM, José Lorenzo <jose.zap@gmail.com> wrote:
Do you have debug set to `true` in app.php? What happens if you use var_dump instead?


On Wednesday, April 30, 2014 8:00:29 PM UTC+2, Bayezid Alam wrote:
I tried by pr/debug($this->request->data); pr/debug($article) but showing nothing


On Wed, Apr 30, 2014 at 11:51 PM, Md Bayezid Alam <bayezidece@gmail.com> wrote:
i tried but It's showing nothing.. Could you please let me know how can i get this? Thanks


On Wed, Apr 30, 2014 at 11:24 PM, euromark <dereuromark@gmail.com> wrote:
And what is your problem?
The function still exists and can be used the same way.


Am Mittwoch, 30. April 2014 16:27:00 UTC+2 schrieb Bayezid Alam:
Dear All,

Is there any way to print from Controller?

For example,

I have a form like 

<?php
    echo $this->Form->create($article);
    echo $this->Form->input('title');
    echo $this->Form->input('body', ['rows' => '3']);
    echo $this->Form->button(__('Save Articles'));
    echo $this->Form->end();
?>

I have function in controller

public function add(){
        $article = $this->Articles->newEntity($this->request->data);
        if($this->request->is('post')){
            if($this->Articles->save($article)){
                $this->Session->setFlash(__('Your article has been saved.'));
                return $this->redirect(['action' => 'index']);
            }
            $this->Session->setFlash(__('Unable to add your article.'));
        }
        
        $this->set(compact('article'));
    }

I want to check by printing via pr() /  dubug() from my add function like i can do from Cakephp 2.xx.

--
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+unsubscribe@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.


--
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+unsubscribe@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.

--
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+unsubscribe@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.

No comments: