Thursday, July 31, 2014

Re: Custom components not working on cakephp 3

You're missing the namespace declaration:

namespace App\Controller\Component;

On Thursday, July 31, 2014 3:36:34 PM UTC+2, Jipson Thomas wrote:
Hi ,
I have created a component using the following code on src/Controller/Component/JtfilterComponent.php file

<?php
use Cake\Controller\Component;
class JtfilterComponent extends Component {
    public function doComplexOperation($amount1, $amount2) {
        return $amount1 + $amount2;
    }
}


And on my controller file I added the following code

public $components = ['Paginator','Jtfilter'];

When I am trying to access the controller I am getting the following error.


Missing Component

Error: JtfilterComponent could not be found.

Error: Create the class JtfilterComponent below in file: src/Controller/Component/JtfilterComponent.php

<?php  class JtfilterComponent extends Component {    }  

Notice: If you want to customize this error message, create src/Template/Error/missing_component.ctp

Stack Trace


Would you please help me to fix this?

Regards,
Jipson

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