Thursday, July 31, 2014

Re: Configure::listObjects() and bootstrap.php

Hi

Use App::objects('Controller'); instead of Configure::listObjects() (deprecated now)



On Monday, August 24, 2009 6:12:03 PM UTC+5:30, Pixelastic wrote:
Hello,

I have some code I would like to put in my bootstrap.php that needs
the Configure::listObjects() function. Unfortunately, this function
does not return anything when called from inside the bootstrap.php,
likely because bootstrap is called very very early.

I finally had to put my code in the routes.php file, because that's
the only place I found to get my code loaded as early as possible, but
it is quite an unusual place. And not a very clean way of organizing
things.

Do any of you know a cleaner way to this ?

(P.S : As the listObject() method is quite heavy, I DO cache results
of my custom function for further requests, but I need the first one -
cache empty- to occur before any model creation)

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

Re: Index View with search filter option on Cake PHP 3

Hi Jipson.

I'm the one who migrated the search plugin to cake3. It has not been updated to the New structure yet, so you need to use ./plugins/Search in composer.json

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

unauthorizedRedirect problem

Hi, guys!

I'm developing a little app with cake 2.5.2. After setup Auth component, every time I try to access a unauthorized action typing the url in the address bar, I'm redirected to another url with duplicated cakephp folder. 

Example: localhost/cakephp/test (unauthorized) => localhost/cakephp/cakephp

If I try to access the same url through links (without typing in the address bar), unauthorized redirect works normally. I don't want to set the Auth component property unauthorizedRedirect because I want to be redirected to the previous page, but this is not working if I type an unauthorized url in the address bar.

Can you help me? If I have not been clear, let me know.

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

CakePHP 2.5 and ACL Groups Permissions not working

HI , i have had problems with Cake's ACL.

I followed all the tutorials, had AROS, ACOS and AROS_ACOS table generated. I installed the Alexo's ACL plugin and made it work under version 2.5.2 (finally).

I do have problem with the group permissions. Even though I set only one group to be able to  access specific action, it still allows another group to view the action too.

Basically, the ACL does not work for me at all. What am I missing?

Bellow is the code from AppController:

public $components = array(
'Acl',
   'Auth' => array(
       'loginAction' => array(
           'controller' => 'users',
           'action' => 'login',
                'admin' => false
       ),
       'loginRedirect' => array(
                'controller' => 'users',
                'action' => 'profile',
                'admin' => false
            ),
            'logoutRedirect' => array(
                'controller' => 'users',
                'action' => 'login',
                'admin' => false
            ),
       'authError' => 'Please login to continue',
       'authenticate' => array(
           'Form' => array(
               'fields' => array(
'username' => 'username',
'password' => 'pwd'
),
               'passwordHasher' => array(
                   'className' => 'Simple',
                   'hashType' => 'sha256'
               )
           )
       ),
      'authorize' => array(
                'Actions' => array(
                    'actionPath' => 'controllers'
                 )
            ),
       /*
       'authorize' => array(
   'Actions',
   'Controller'
),
*/
   ),
   'Session'
);




public
 function beforeFilter()

{

    // this is from bootstrap to allow development

if (APP_ACL_ENABLED == 0) {

        // allow everything

        $this->Auth->allow();

    } else {

        // nothing allowed

        $this->Auth->allow(array());

    };

} here...

I have been trying to set this for several days, with no success.... Any help is truly appreciated!!

Thank you, Martin

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

Re: Custom components not working on cakephp 3

Thank you Jose Lorenzo.

Regards,
Jipson

On Thursday, 31 July 2014 14:45:08 UTC+1, José Lorenzo wrote:
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.

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.

Custom components not working on cakephp 3

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.

Autocomplete version 2.5

Hi,
Would you like autocomplete in cakephp version 2.5, 
I've tried several tutorials and could not, can someone help me? a hint which that thing. 
I thank

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

Re: Index View with search filter option on Cake PHP 3

Thank you Jose Lorenzo.

On Thursday, 31 July 2014 13:03:57 UTC+1, José Lorenzo wrote:
Not sure then, try contacting the plugin creator

On Thursday, July 31, 2014 1:38:26 PM UTC+2, Jipson Thomas wrote:
Hi Jose Lorenzo,
Thank you for you post. Actually I stored the plugin files in the public_html/plugin folder manually. Then I modified the composer .json file and executed the dumpautoload command through terminal. Still I/ am getting the error.

Regards,
Jipson

On Thursday, 31 July 2014 12:27:07 UTC+1, José Lorenzo wrote:
I you did not install the plugin with composer, you will need to call this command:

composer dumpautoload

On Thursday, July 31, 2014 11:48:43 AM UTC+2, Jipson Thomas wrote:
Hi Euromark & Stephen

Thank you very much. But on loading the plugin I am getting an error as following.
Error: Search.PrgComponent could not be found.
Error: Create the class PrgComponent below in file: /Applications/XAMPP/xamppfiles/htdocs/prms.panovus.com/public_html/plugins/Search//Controller/Component/PrgComponent.php

Actually I have the plugin files on place and I added the following line on bootstrap.php file to load plugin.
Plugin::load('Search');
Also I updated the composer.jason file by adding the following
"autoload": {
        "psr-4": {
            "App\\": "src",
            "App\\Test\\": "tests",
            "Search\\": "./plugins/Search/src",
                "Search\\Test\\": "./plugins/Search/tests"
        }
    },
and updated composer through commandline.  by executing php composer.phar update and  php composer.phar dumpautoload

Would you please help me to find what is wrong in it?

Regards,
Jipson

On Wednesday, 30 July 2014 18:12:47 UTC+1, euromark wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: Index View with search filter option on Cake PHP 3

Not sure then, try contacting the plugin creator

On Thursday, July 31, 2014 1:38:26 PM UTC+2, Jipson Thomas wrote:
Hi Jose Lorenzo,
Thank you for you post. Actually I stored the plugin files in the public_html/plugin folder manually. Then I modified the composer .json file and executed the dumpautoload command through terminal. Still I/ am getting the error.

Regards,
Jipson

On Thursday, 31 July 2014 12:27:07 UTC+1, José Lorenzo wrote:
I you did not install the plugin with composer, you will need to call this command:

composer dumpautoload

On Thursday, July 31, 2014 11:48:43 AM UTC+2, Jipson Thomas wrote:
Hi Euromark & Stephen

Thank you very much. But on loading the plugin I am getting an error as following.
Error: Search.PrgComponent could not be found.
Error: Create the class PrgComponent below in file: /Applications/XAMPP/xamppfiles/htdocs/prms.panovus.com/public_html/plugins/Search//Controller/Component/PrgComponent.php

Actually I have the plugin files on place and I added the following line on bootstrap.php file to load plugin.
Plugin::load('Search');
Also I updated the composer.jason file by adding the following
"autoload": {
        "psr-4": {
            "App\\": "src",
            "App\\Test\\": "tests",
            "Search\\": "./plugins/Search/src",
                "Search\\Test\\": "./plugins/Search/tests"
        }
    },
and updated composer through commandline.  by executing php composer.phar update and  php composer.phar dumpautoload

Would you please help me to find what is wrong in it?

Regards,
Jipson

On Wednesday, 30 July 2014 18:12:47 UTC+1, euromark wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: $this->Form->create() and View blocks

Yes, it returns an entity. I can simplify a little more:

<div>
  <h2><?php echo 'Test Cases - VIEW BLOCK'; ?></h2>
   <div class="container">
    <?php
      echo $this->Form->create($test);
         echo $this->fetch('cadastro_data');
       echo $this->Form->end();
    ?>
  </div>
</div>

After some debugging I guess I found the problem!
Cause "$this->Form->create($test)" is in other view that the " $this->Form->input(...);", the Form->inputs are processed before the Form->Create and it has no entity yet!


Em quinta-feira, 31 de julho de 2014 08h28min13s UTC-3, José Lorenzo escreveu:
What does $this->get('test') return? Is it an entity?

On Thursday, July 31, 2014 3:47:47 AM UTC+2, Tiago Barrionuevo wrote:
Hi,

I'm trying to build a form, with a CakePHP 3 application, using view blocks but I can't get it to work. It seens that the Form->create() doesn't find the model.
I build a simple form to test it (controller Tests):


src/Template/Tests/view_block.ctp

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW_BLOCK');
$this->set('cadastro_entity', $this->get('test'));

$this->extend('/Common/cadastro_editor');

$this->start('cadastro_data');
?>

<fieldset>
  <div class="row">
    <?= $this->Form->input('id', array('label' => 'Id:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('name', array('label' => 'Name:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('result', array('label' => 'Result:' ));?>
  </div>
</fieldset>

<?php $this->end(); ?>

---------------------------------------------------------------------------
src/Template/Common/cadastro_editor.ctp

<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>
 
  <div class="container">
    <?php
        echo $this->Form->create($this->get('test') );
        //echo $this->Form->create($this->get('cadastro_entity') );
 
        echo $this->fetch('cadastro_data');
 
      echo $this->Form->end();
    ?>
  </div>
</div>
 
======================================
The same form without view block works ok:

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW');
?>
<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>

  <div class="container">
    <?php
      echo $this->Form->create($this->get('test') );
    ?>

    <fieldset>
      <div class="row">
        <?= $this->Form->input('id', array('type'=>'text', 'label' => 'Id:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('name', array('label' => 'Name:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('result', array('label' => 'Result:' )); ?>
      </div>
    </fieldset>
  </div>
</div>


Maybe I'm doing something wrong!

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

Re: Index View with search filter option on Cake PHP 3

Hi Jose Lorenzo,
Thank you for you post. Actually I stored the plugin files in the public_html/plugin folder manually. Then I modified the composer .json file and executed the dumpautoload command through terminal. Still I/ am getting the error.

Regards,
Jipson

On Thursday, 31 July 2014 12:27:07 UTC+1, José Lorenzo wrote:
I you did not install the plugin with composer, you will need to call this command:

composer dumpautoload

On Thursday, July 31, 2014 11:48:43 AM UTC+2, Jipson Thomas wrote:
Hi Euromark & Stephen

Thank you very much. But on loading the plugin I am getting an error as following.
Error: Search.PrgComponent could not be found.
Error: Create the class PrgComponent below in file: /Applications/XAMPP/xamppfiles/htdocs/prms.panovus.com/public_html/plugins/Search//Controller/Component/PrgComponent.php

Actually I have the plugin files on place and I added the following line on bootstrap.php file to load plugin.
Plugin::load('Search');
Also I updated the composer.jason file by adding the following
"autoload": {
        "psr-4": {
            "App\\": "src",
            "App\\Test\\": "tests",
            "Search\\": "./plugins/Search/src",
                "Search\\Test\\": "./plugins/Search/tests"
        }
    },
and updated composer through commandline.  by executing php composer.phar update and  php composer.phar dumpautoload

Would you please help me to find what is wrong in it?

Regards,
Jipson

On Wednesday, 30 July 2014 18:12:47 UTC+1, euromark wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: $this->Form->create() and View blocks

What does $this->get('test') return? Is it an entity?

On Thursday, July 31, 2014 3:47:47 AM UTC+2, Tiago Barrionuevo wrote:
Hi,

I'm trying to build a form, with a CakePHP 3 application, using view blocks but I can't get it to work. It seens that the Form->create() doesn't find the model.
I build a simple form to test it (controller Tests):


src/Template/Tests/view_block.ctp

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW_BLOCK');
$this->set('cadastro_entity', $this->get('test'));

$this->extend('/Common/cadastro_editor');

$this->start('cadastro_data');
?>

<fieldset>
  <div class="row">
    <?= $this->Form->input('id', array('label' => 'Id:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('name', array('label' => 'Name:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('result', array('label' => 'Result:' ));?>
  </div>
</fieldset>

<?php $this->end(); ?>

---------------------------------------------------------------------------
src/Template/Common/cadastro_editor.ctp

<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>
 
  <div class="container">
    <?php
        echo $this->Form->create($this->get('test') );
        //echo $this->Form->create($this->get('cadastro_entity') );
 
        echo $this->fetch('cadastro_data');
 
      echo $this->Form->end();
    ?>
  </div>
</div>
 
======================================
The same form without view block works ok:

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW');
?>
<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>

  <div class="container">
    <?php
      echo $this->Form->create($this->get('test') );
    ?>

    <fieldset>
      <div class="row">
        <?= $this->Form->input('id', array('type'=>'text', 'label' => 'Id:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('name', array('label' => 'Name:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('result', array('label' => 'Result:' )); ?>
      </div>
    </fieldset>
  </div>
</div>


Maybe I'm doing something wrong!

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

Re: Index View with search filter option on Cake PHP 3

I you did not install the plugin with composer, you will need to call this command:

composer dumpautoload

On Thursday, July 31, 2014 11:48:43 AM UTC+2, Jipson Thomas wrote:
Hi Euromark & Stephen

Thank you very much. But on loading the plugin I am getting an error as following.
Error: Search.PrgComponent could not be found.
Error: Create the class PrgComponent below in file: /Applications/XAMPP/xamppfiles/htdocs/prms.panovus.com/public_html/plugins/Search//Controller/Component/PrgComponent.php

Actually I have the plugin files on place and I added the following line on bootstrap.php file to load plugin.
Plugin::load('Search');
Also I updated the composer.jason file by adding the following
"autoload": {
        "psr-4": {
            "App\\": "src",
            "App\\Test\\": "tests",
            "Search\\": "./plugins/Search/src",
                "Search\\Test\\": "./plugins/Search/tests"
        }
    },
and updated composer through commandline.  by executing php composer.phar update and  php composer.phar dumpautoload

Would you please help me to find what is wrong in it?

Regards,
Jipson

On Wednesday, 30 July 2014 18:12:47 UTC+1, euromark wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: Index View with search filter option on Cake PHP 3

Hi Euromark & Stephen

Thank you very much. But on loading the plugin I am getting an error as following.
Error: Search.PrgComponent could not be found.
Error: Create the class PrgComponent below in file: /Applications/XAMPP/xamppfiles/htdocs/prms.panovus.com/public_html/plugins/Search//Controller/Component/PrgComponent.php

Actually I have the plugin files on place and I added the following line on bootstrap.php file to load plugin.
Plugin::load('Search');
Also I updated the composer.jason file by adding the following
"autoload": {
        "psr-4": {
            "App\\": "src",
            "App\\Test\\": "tests",
            "Search\\": "./plugins/Search/src",
                "Search\\Test\\": "./plugins/Search/tests"
        }
    },
and updated composer through commandline.  by executing php composer.phar update and  php composer.phar dumpautoload

Would you please help me to find what is wrong in it?

Regards,
Jipson

On Wednesday, 30 July 2014 18:12:47 UTC+1, euromark wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: Model Validation

Are you submitting the entire form or individual fields via ajax?

If you're submitting the entire form and returning HTML, make sure to set your $invalidFields variable which you have and check if(isset($invalidFields)) in your returned html to highlight the fields. If you're still not sure please post your ajax code as well as all the relevant controller code so we can see exactly what you are doing wrong. Thanks


On 31 July 2014 09:37, Sudhir Pandey <shidhu047@gmail.com> wrote:
Thanks for your response , but I submitting the form by ajax & then validate. I have encode the error & get it on success method of ajax. The problem arising  How can I show these error message .

I want model validation using ajax 


On Wednesday, 30 July 2014 14:59:03 UTC+5:30, Dr. Tarique Sani wrote:
Start here http://bit.ly/UKovlN

If you get stuck with a method you choose ask further questions.

Tarique


On Wed, Jul 30, 2014 at 2:40 PM, Sudhir Pandey <shid...@gmail.com> wrote:
How can I perform cakephp Model validation using ajax & shows error message.

I have already set the error message in controller but not shown in view.

$this->Candidateprofile->set($this->data);
if($this->Candidateprofile->validates())
{
$this->Candidateprofile->create();
if($this->Candidateprofile->saveAll($this->data)) {
}else{
$invalidFields=$this->Candidateprofile->invalidFields();
$this->set('invalidFields',$invalidFields);
}
}else{
$invalidFields=$this->Candidateprofile->invalidFields();
$this->set('invalidFields',$invalidFields);
}

--
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+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.

Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



--
=============================================================
The Conference Schedule Creator : http://shdlr.com

PHP for E-Biz : http://sanisoft.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+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.



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

Re: 403 error

Thanks Andy. Turns out it was something much simpler. I use MAMP Pro and had the cache module set to APC. As soon as I turned that off the issue went away.

On 31 Jul 2014, at 06:52, AD7six <andydawson76@gmail.com> wrote:

> That sounds like a consequence of web requests and CLI requests sharing the same tmp folder. E.g. executing Console/cake as root will create cache and log files which the web user can't edit.
>
> If that's the problem the simplest solution is to use different tmp folder locations for web and CLI requests.
>
> Hth,
>
> AD
>
> --
> 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.

Re: Model Validation

Thanks for your response , but I submitting the form by ajax & then validate. I have encode the error & get it on success method of ajax. The problem arising  How can I show these error message .

I want model validation using ajax 

On Wednesday, 30 July 2014 14:59:03 UTC+5:30, Dr. Tarique Sani wrote:
Start here http://bit.ly/UKovlN

If you get stuck with a method you choose ask further questions.

Tarique


On Wed, Jul 30, 2014 at 2:40 PM, Sudhir Pandey <shid...@gmail.com> wrote:
How can I perform cakephp Model validation using ajax & shows error message.

I have already set the error message in controller but not shown in view.

$this->Candidateprofile->set($this->data);
if($this->Candidateprofile->validates())
{
$this->Candidateprofile->create();
if($this->Candidateprofile->saveAll($this->data)) {
}else{
$invalidFields=$this->Candidateprofile->invalidFields();
$this->set('invalidFields',$invalidFields);
}
}else{
$invalidFields=$this->Candidateprofile->invalidFields();
$this->set('invalidFields',$invalidFields);
}

--
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+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



--
=============================================================
The Conference Schedule Creator : http://shdlr.com

PHP for E-Biz : http://sanisoft.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+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.

Problem on CakePHP Plugin - Error “Controller could not be found”


I'm currently using CakePHP 2.5.2 I want to integrate a plugin to manage Users. I tested it in a first time as a single CakePHP Application (controllers in app/controller, models in app/model, views in app/view/Users): was ok.

I'm trying now to convert it as a plugin: I've created a folder UserManager in app/plugin.

When I try to go to the url of one of my controllers, I get the message Missing Controller. All plugin are loaded in Bootstrap.php (CakePlugin::loadAll();).

I tried to find similar problems vs solutions but no one was relevant with my problem (I tried some proposed solutions but root causes were different.

When I look at DebugKit in Include section, I can observe that my DebugKit plugin is loaded but not my other plugin...

Could some one suggest me a solution ? Thanks in advance.

(Please find bellow a description of the code)

I added controllers, models and views as follows (skeleton generated by Bake and checked: ok):

1) Models in app/plugin/model

UserManagerAppModel.php

<?php  App::uses('AppModel', 'Model');  class UserManagerAppModel extends AppModel {  }  ?>

User.php

<?php  App::uses('AuthComponent', 'Controller/Component');  class User extends UserManagerAppModel {    ...  }  ?>

2) Controllers in app/plugin/controller

UserManagerAppModel.php:

<?php  App::uses('AppController', 'Controller');  class UserManagerAppController extends AppController {  }  ?>

UserController.php:

<?php  class UsersController extends UserManagerAppController {      public $uses = array('UserManager.User');      public function beforeFilter() {          parent::beforeFilter();          $this->Auth->allow('*');       }      public function login() {                 }      ...  ?>  

3)Views in app/plugin/view/Users

Nothing special.

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

Wednesday, July 30, 2014

database structure for school management

developing school system management in cakephp, everything is fine but there is special requirement for client that he has lots of branches of his school and he want to manage in single apps.It is possible but i little bit confuse how to manage database by which everystaff and student can view his details or manage by branchwise.

So can sombody support how to create table to manage every user and his details on branchwise. and there is superadmin who can handle all the branches

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

print document in cakephp

want to give the option to print document,but have no idea how it will be in cakephp.

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

Re: 403 error

That sounds like a consequence of web requests and CLI requests sharing the same tmp folder. E.g. executing Console/cake as root will create cache and log files which the web user can't edit.

If that's the problem the simplest solution is to use different tmp folder locations for web and CLI requests.

Hth,

AD

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

$this->Form->create() and View blocks

Hi,

I'm trying to build a form, with a CakePHP 3 application, using view blocks but I can't get it to work. It seens that the Form->create() doesn't find the model.
I build a simple form to test it (controller Tests):


src/Template/Tests/view_block.ctp

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW_BLOCK');
$this->set('cadastro_entity', $this->get('test'));

$this->extend('/Common/cadastro_editor');

$this->start('cadastro_data');
?>

<fieldset>
  <div class="row">
    <?= $this->Form->input('id', array('label' => 'Id:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('name', array('label' => 'Name:' ));?>
  </div>

  <div class="row">
    <?= $this->Form->input('result', array('label' => 'Result:' ));?>
  </div>
</fieldset>

<?php $this->end(); ?>

---------------------------------------------------------------------------
src/Template/Common/cadastro_editor.ctp

<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>
 
  <div class="container">
    <?php
        echo $this->Form->create($this->get('test') );
        //echo $this->Form->create($this->get('cadastro_entity') );
 
        echo $this->fetch('cadastro_data');
 
      echo $this->Form->end();
    ?>
  </div>
</div>
 
======================================
The same form without view block works ok:

<?php
$this->set('cadastro_title', $this->get('search_modulename') . ' - VIEW');
?>
<div>
  <h2><?php echo $this->get('cadastro_title'); ?></h2>

  <div class="container">
    <?php
      echo $this->Form->create($this->get('test') );
    ?>

    <fieldset>
      <div class="row">
        <?= $this->Form->input('id', array('type'=>'text', 'label' => 'Id:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('name', array('label' => 'Name:' ));?>
      </div>

      <div class="row">
        <?= $this->Form->input('result', array('label' => 'Result:' )); ?>
      </div>
    </fieldset>
  </div>
</div>


Maybe I'm doing something wrong!

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

Re: paths in cake environment being mangled

They were mangled as described above in the 'Environment' tab of the 'DebugKit.Toolbar'
-- doh --
Perhaps an update to my copy of the DebugKit plugin then? Not sure exactly what version I am actually using. Will look into that.

On Thursday, 24 July 2014 10:41:23 UTC-4, José Lorenzo wrote:
How did you determine the paths were mangled?

On Thursday, July 24, 2014 3:10:54 PM UTC+2, McScreech wrote:
bump

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

Re: Index View with search filter option on Cake PHP 3

My mistake, I overlooked this was for CakePHP3 (it has been a long day), please disregard my comment.


On 30 July 2014 18:12, euromark <dereuromark@gmail.com> wrote:
Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.



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

Re: Index View with search filter option on Cake PHP 3

Look into the cake3 branch of https://github.com/CakeDC/search/tree/3.0


Am Mittwoch, 30. Juli 2014 17:34:01 UTC+2 schrieb Jipson Thomas:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: Index View with search filter option on Cake PHP 3

You can do this using queries and form submit or ajax, a very simple example in theory would be to have a filter say username, then on submit if $this->request->data['Model']['username'] is not null then pass a LIKE condition to the paginate query.

It's simple practice but something you will have to attempt yourself and then ask more specific questions if you get stuck, not something that is included as a full feature by default.

HTH, Stephen


On 30 July 2014 16:34, Jipson Thomas <jipson@strategic-ic.co.uk> wrote:
Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.



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

Index View with search filter option on Cake PHP 3

Hi,
Would you please let me know whether  cakephp3 have an option for search filters on index view.
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.

Re: Display Form Validation Errors CakePHP 3

Glad it worked :)

On Wednesday, July 30, 2014 3:35:21 PM UTC+2, Jipson Thomas wrote:
Hi Jose Lorenzo,
Thank you very much. Now it is working perfectly.
Regards,
Jipson

On Wednesday, 30 July 2014 14:31:30 UTC+1, José Lorenzo wrote:
Ok, you problem is that you are calling create() without the entity, You should get that fixed by doing:

<?php echo $this->Form->create($package) ?>

On Wednesday, July 30, 2014 3:29:33 PM UTC+2, Jipson Thomas wrote:
Hi Jose Lorenzo,
Thank you for the reply. Please find the below code

CTP
======
<div class="users form">
<?php echo $this->Flash->render('auth') ?>
<?php echo $this->Form->create() ?>
    <fieldset>
        <legend><?php echo __('Please enter the package details') ?></legend>
       <?php echo $this->Form->input('name', ['label' => 'Package Name']); ?>
       <?php echo $this->Form->input('annual_price', ['label' => 'Price / Year','type' => 'decimal']); ?>
       <?php echo $this->Form->input('monthly_price', ['label' => 'Price / Month','type' => 'decimal']); ?>
       <?php echo $this->Form->input('duration', ['label' => 'Minimum Months of Contract','type' => 'integer']);?>
       <?php echo $this->Form->input('no_partners', ['label' => 'Maximum No of Partners','type' => 'integer']);?>
       <?php echo $this->Form->input('no_emails', ['label' => 'Maximum No of Emails/Month','type' => 'integer']);?>
       <?php echo $this->Form->input('storage', ['label' => 'Maximum Allowed Storage Space (GB)','type' => 'integer']);?>
       <?php echo $this->Form->input('resource_library', ['label' => 'Resource Library','type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('portal_cms', ['label' => 'Portal CMS','type' => 'checkbox','value'=>'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('MDF', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('deal_registration', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('partner_recruit', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('training', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('Socialmedia', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('multilingual', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('partner_incentive', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
       <?php echo $this->Form->input('partner_app', ['type' => 'checkbox','value' => 'Y','hiddenField' => 'N']);?>
      
    </fieldset>
<?php echo $this->Form->button(__('Save')); ?>
<?php echo $this->Form->end() ?>
</div>

Controller Action
==============
public function add(){
        $package = $this->Package->newEntity($this->request->data);
        if ($this->request->is('post')) {
            if ($this->Package->save($package)) {
                $this->Flash->success(__('The package has been saved.'));
                return $this->redirect(['action' => 'index']);
            }
            else{
              //  $errors = $this->Package->errors();
               
                $error_string=  implode('\n',$package->errors());
                //print_r($package);
            }
            $this->Flash->error(__('Unable to add the package.'));
        }
        $this->set('package', $package);
    }

Model - Table Class
=================
class PackagesTable extends Table {
    public function initialize(array $config) {
        $this->addBehavior('Timestamp', [
            'events' => [
                'Model.beforeSave' => [
                    'created_on' => 'new',
                    'modified_on' => 'always',
                ]
               
            ]
        ]);
    }
    public function validationDefault(Validator $validator) {
        $validator
            ->notEmpty('name','A valid package name is required')
            ->notEmpty('annual_price','A valid annual price is required')
            ->notEmpty('monthly_price','A valid monthly price is required')
            ->notEmpty('duration','Minimum duration of contract is required')
            ->notEmpty('no_partners','Maximum no of partners is required')
            ->notEmpty('no_emails','Maximum no of emails per month is required');

        return $validator;
    }
}

Regards,
Jipson

On Wednesday, 30 July 2014 14:20:54 UTC+1, Jipson Thomas wrote:
Hi ,
On my package creation form I am using cakephp validation. The validation is working perfectly. Unfortunately the validation error messages are not displaying on my form. Would you please help me on this?

The code I am using is as follows. Please advise me what I am missing here.

My Table Class

==============
public function validationDefault(Validator $validator) {
        $validator
            ->notEmpty('name','A valid package name is required')
            ->notEmpty('annual_price','A valid annual price is required')
            ->notEmpty('monthly_price','A valid monthly price is required')
            ->notEmpty('duration','Minimum duration of contract is required')
            ->notEmpty('no_partners','Maximum no of partners is required')
            ->notEmpty('no_emails','Maximum no of emails per month is required');

        return $validator;
    }

On my controller

================
I am using the following codes to get the validation result.
$package = $this->Package->newEntity($this->request->data);
if ($this->SubscriptionPackage->save($package)) {
                $this->Flash->success(__('The package has been saved.'));
                return $this->redirect(['action' => 'index']);
            }
            else{
//print_r($package->errors()); It will display an array with field names and message.
}

On my ctp file I am using the following code.
====================================
 <?php echo $this->Form->input('name', ['label' => 'Package Name']); ?>
       <?php echo $this->Form->input('annual_price', ['label' => 'Price / Year','type' => 'decimal']); ?>
       <?php echo $this->Form->input('monthly_price', ['label' => 'Price / Month','type' => 'decimal']); ?>
       <?php echo $this->Form->input('duration', ['label' => 'Minimum Months of Contract','type' => 'integer']);?>
       <?php echo $this->Form->input('no_partners', ['label' => 'Maximum No of Partners','type' => 'integer']);?>
       <?php echo $this->Form->input('no_emails', ['label' => 'Maximum No of Emails/Month','type' => 'integer']);?>
       <?php echo $this->Form->input('storage', ['label' => 'Maximum Allowed Storage Space (GB)','type' =>?>

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