Mutliple validation not working

2016-03-19 Thread Marcus James
Hi, I am using cakephp version 3, i am trying to add multiple validation but its not working on password field $validator = new Validator(); $validator ->requirePresence('email', 'create') ->notEmpty('email',['

Re: Form: hasMany fields table validation not working

2016-02-29 Thread Paulo Terra
Ok, thank you very much! I am sorry that I didn't realize this singular and plural detail. Thank you very much! Paulo 2016-02-29 11:36 GMT-03:00 Dakota : > Not a problem, glad that worked for you. > > For future reference, you can usually get nearly instant help on the IRC > channel ( > http://

Re: Form: hasMany fields table validation not working

2016-02-29 Thread Dakota
Not a problem, glad that worked for you. For future reference, you can usually get nearly instant help on the IRC channel (http://webchat.freenode.net/?channels=cakephp&uio=MT1mYWxzZSY5PXRydWUmMTE9MjQ2b8), depending on who is online of course. Stackoverflow is also usually more active than th

Re: Form: hasMany fields table validation not working

2016-02-29 Thread Paulo Terra
Great! It Works! Thank you Dakota! 2016-02-29 11:15 GMT-03:00 Dakota : > Hi Paulo, > > Your form field for address zipcode field is in the wrong format. > http://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data > shows the correct format for each type of relatio

Re: Form: hasMany fields table validation not working

2016-02-29 Thread Dakota
Hi Paulo, Your form field for address zipcode field is in the wrong format. http://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data shows the correct format for each type of relation. Basically, instead of doing $this->Form->input('address.zipcode'); You n

Form: hasMany fields table validation not working

2016-02-28 Thread Paulo Terra
Hi, I have 3 tables: User, Buyer and Address: User hasMany Address User hasOne Buyer Address belongsTo User Buyer belongsTo User In the User form (Users/add.ctp): echo $this->Form->input('name',['label' => __('Nome')]); echo $this->Form->input('buyer.cpf',['label' => __('CPF')]); echo $this->Fo

Re: Bug: flaws in email validation/sending

2016-01-31 Thread euromark
Please open a ticket at https://github.com/cakephp/cakephp/issues This is just a discission board, not a bug tracker. Mark Am Samstag, 30. Januar 2016 05:33:10 UTC+1 schrieb Kim: > > >- CakePHP's email validation allows non-ASCII letter characters, e.g. >á, in the

Bug: flaws in email validation/sending

2016-01-29 Thread Kim
- CakePHP's email validation allows non-ASCII letter characters, e.g. á, in the local part of the email address (by the \p{L} unicode category construct). This should not be allowed, see https://en.wikipedia.org/wiki/Email_address#Local_part. - It also allows non-

hasmany validation and save data in a form, best approach

2015-12-29 Thread Raul Magdalena Catala
with invoice items and you do not wants that the validation rules be applied to these rows that are not used. the question is, what is the best approach to accomplish this? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received

validation for multiply table in single view

2015-11-15 Thread Dhingani Yatin
hello how can i set validation for multiple table in cakephp 3.x my field is Form->input('Downloads.DownloadContents.image_text',array('label' => false,'div'=>false,'type'=>'text','class'=>'form-control','

cakephp 3 validation

2015-09-25 Thread Dhingani Yatin
Hello, How can i set validation without page refresh in cakephp 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 unsubscribe

help with uploadedFile validation rule

2015-09-17 Thread Raul Magdalena Catala
hello, i can not understand how uploadedFile validation rule works, http://api.cakephp.org/3.0/class-Cake.Validation.Validation.html#_uploadedFile can someone help me with and example, expanding below code? $validator ->add('image', ['rule' => ['uploaded

Table's save() fails, where to get the error message? (other than validation errors)

2015-09-14 Thread Ernesto Borio
I can't find in the documentation how to collect error messages (other than validation errors) for when a table's save() or delete() fail, how is it done? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received th

saveMany validation not working correctly

2015-07-06 Thread Javi
Array( [Doc] => Array ( [files] => Array ( [0] => Array ( [name] => 4_54718093804437603.pdf [type] => application/pdf [tmp_name]

Re: Validation Example

2015-07-01 Thread joserafael
Use 'message'. For more information visit: http://book.cakephp.org/3.0/en/core-libraries/validation.html#creating-validators El viernes, 26 de junio de 2015, 7:17:53 (UTC-4:30), Kingston Abraham escribió: > > How will the error messages in validator will appear. Is there any live > example to

Validation Example

2015-06-26 Thread Kingston Abraham
How will the error messages in validator will appear. Is there any live example to see -- 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 unsubs

Re: Cakephp 3.x Validation Error issue

2015-05-15 Thread José Lorenzo
x27;form-control']); >>> >>> $this->Form->input('FormElements.text.2.title', ['type'=>'text', >>> 'label'=>false, 'class'=>'form-control']); >>> >>> $this->Form->input('For

Re: Cakephp 3.x Validation Error issue

2015-05-15 Thread Thomas
ormElements.textarea.1.description', >> ['type'=>'textarea', 'label'=>false, 'class'=>'form-control']); >> >> $this->Form->input('FormElements.textarea.2.description', >> ['type'=>&

Re: Cakephp 3.x Validation Error issue

2015-05-06 Thread Thomas
>'form-control']); > > $this->Form->input('FormElements.textarea.1.description', > ['type'=>'textarea', 'label'=>false, 'class'=>'form-control']); > > $this->Form->input('FormElements.textarea

Re: Cakephp 3.x Validation Error issue

2015-04-23 Thread Cake Developer
tried?* In cakephp 2.x I have written validations like following but I have no idea how to try multiple index validation in cakephp 3.x Cakephp 2.x Form fields are $this->Form->input('FormElement.text.1.title', ['type'=>'text', 'label'=>f

Re: Cakephp 3.x Validation Error issue

2015-04-23 Thread John Andersen
Please provide more information and also real life examples of your form code, so that we may better be able to help. Have you studied the CakePHP book? What have you tried? What does not work? Do you get any error messages? Please show the validation code you have tried, the code for the form

Re: Cakephp 3.x Validation Error issue

2015-04-22 Thread Cake Developer
>'form-control']); > > $this->Form->input('FormElements.textarea.1.description', > ['type'=>'textarea', 'label'=>false, 'class'=>'form-control']); > > $this->Form->input('FormElements.textarea.2.descrip

Cakephp 3.x Validation Error issue

2015-04-21 Thread Cake Developer
put('FormElements.text.2.title', ['type'=>'text', 'label'=>false, 'class'=>'form-control']); $this->Form->input('FormElements.textarea.1.description', ['type'=>'textarea', 'label'=&g

Re: [Cake 2.6.3] Cake's FileUpload Validation not working; what is wrong?

2015-04-13 Thread Willem
It worked thanks! On Monday, April 13, 2015 at 6:18:36 PM UTC+2, John Andersen wrote: > > The validation in your model points to a field named "image", but the view > you have points to a field named "submittedFile" :) > Which is the correct one? > Enjoy, John

Re: [Cake 2.6.3] Cake's FileUpload Validation not working; what is wrong?

2015-04-13 Thread Willem
Hi, thanks, will try this ASAP. I got it mixed up thiking it was an alias/name/labe as in multiple validations per field. :-S On Monday, April 13, 2015 at 6:18:36 PM UTC+2, John Andersen wrote: > > The validation in your model points to a field named "image", but the view &

Re: [Cake 2.6.3] Cake's FileUpload Validation not working; what is wrong?

2015-04-13 Thread John Andersen
The validation in your model points to a field named "image", but the view you have points to a field named "submittedFile" :) Which is the correct one? Enjoy, John On Monday, 13 April 2015 11:17:13 UTC+3, Willem wrote: > > I have a model "Attachment" whi

[Cake 2.6.3] Cake's FileUpload Validation not working; what is wrong?

2015-04-13 Thread Willem
;, 'png', 'jpg') ), 'message' => 'Please supply a valid image.' ) ); public function beforeSave($options = array()) { parent::beforeSave($options); } public function beforeValidate($options = array()) {

Re: File upload validation

2015-03-01 Thread Charles Beasley
eValidate" you can do all the photo uploading and field-setting logic and return TRUE. Alternatively, you can return FALSE to prevent further validation if there is an error. *NOTE: If *beforeValidate* returns FALSE CakePHP will short-circuit and "* validates()*" DOES NOT execute.

Re: File upload validation

2015-03-01 Thread Sam Clauw
Charles, thank you for the great effort! But is there no other option than move the validation into the controller instead of doing it in the model? The code I wrote only contains one single if/else and is very clear to me. Okay, it's not working so I'm not getting anywhere for the

Re: File upload validation

2015-02-28 Thread Charles Beasley
You can get rid of the $unset_photo variable I didn't end up using it. --Charles On Sat, Feb 28, 2015 at 6:48 PM, Charles Beasley wrote: > I'm sorry.. I replied quickly via cell phone. A better response is as > follows. > > Try the following code: > > > > class Outlet extends CoasterCmsAp

Re: File upload validation

2015-02-28 Thread Charles Beasley
I'm sorry.. I replied quickly via cell phone. A better response is as follows. Try the following code: array( 'rule' => 'notEmpty', // verplicht 'message' => 'Nameis required.', 'allowEmpty' => true ), 'intro' => array( 'rule

Re: File upload validation

2015-02-28 Thread Charles Beasley
I think you should change your function to beforeValidate On Feb 28, 2015 5:54 PM, "Sam Clauw" wrote: > Okay Charles , that makes sense so I changed my code: > > > > class Outlet extends CoasterCmsAppModel > { > public $validate = array( > 'name' => array( > 'rule' => 'no

Re: File upload validation

2015-02-28 Thread Sam Clauw
Okay Charles , that makes sense so I changed my code: array( 'rule' => 'notEmpty', // verplicht 'message' => 'Nameis required.', 'allowEmpty' => true ), 'intro' => array( 'rule' => 'notEmpty', // verplicht 'message' => 'I

Re: File upload validation

2015-02-28 Thread Charles Beasley
#x27;] is transitioning from an array to a string. You would have to make sure that $this->data['Outlet']['photo'] contains a string value when validate() is executed. Is it possible that your afterValidate function is supposed to be beforeValidate? --Charles On Sat, Feb

File upload validation

2015-02-28 Thread Sam Clauw
I have a problem with my file upload validation in CakePHP. When I add a new record with an image upload field... - ... image should be required. - ... image file extension sould be jpg, png or gif. When I edit an existing record with an image upload field... - ... image is not

Re: CakePHP-3 Plugins form validation messages and field values

2015-02-23 Thread Gaurav Kumar
Created the comment form in >> post's view.ctp file and able to add the comments. But when the values of >> the comment form are wrong(email format is not proper or empty) then i am >> not getting the validation message in front of the respected fields and the >> values ar

Re: Handle validation rule message inside controller

2015-02-23 Thread Andras Kende
http://book.cakephp.org/2.0/en/models/data-validation/validating-data-from-the-controller.html First, set the data to the model: $this->ModelName->set($this->request->data); Then, to check if the data validates, use the validates method of the model, which will return true if it v

Re: CakePHP-3 Plugins form validation messages and field values

2015-02-23 Thread José Lorenzo
le and able to add the comments. But when the values of > the comment form are wrong(email format is not proper or empty) then i am > not getting the validation message in front of the respected fields and the > values are not refilled. > > Also would like to know what would be the p

Handle validation rule message inside controller

2015-02-23 Thread giuseppe giorgio
Hi there, i've start to learn cake php yesterday, and i have a question. I've declared validation array inside my model class like: public $validate = array( 'username' => array( 'alphaNumeric' => array( 'rule' =&g

CakePHP-3 Plugins form validation messages and field values

2015-02-19 Thread Gaurav Kumar
I have just created a CommentManager plugin. Created the comment form in post's view.ctp file and able to add the comments. But when the values of the comment form are wrong(email format is not proper or empty) then i am not getting the validation message in front of the respected field

[3.0] Validation, how to replace beforeValidate

2015-02-18 Thread RobertMei
Hi Until beforeValidate has been removed i kept logic like this in beforeValidate public function beforeValidate(Event $event, Entity $entity) { if( $entity->isNew() ) { $businessType = $entity->customer->businessType; if( $businessType == BusinessType::BUSINESS_TYPE_PERSON ) $entity->b2_type

cakephp the rule validation function run twice

2015-02-08 Thread Celia Kessassi
whene i use this code it's repeat the function isExif_imagetype 'ProfileImage' => array( 'rule' => 'isExif_imagetype', // ou bien : array('nomRegle', 'parametre1', 'parametre2' ...) 'message'=> 'Votre message d\'erreur' ), , but whene i add

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-10 Thread Lorne Dudley
anual properly, I think >>>> it wants me to store the custom widget under the >>>> /vendor/cakephp/cakephp/src/View/Widget/ directory structure ? >>>> >>>> If this is correct then would the custom widget be wiped out every time >>>> I

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread Lorne Dudley
s correct then would the custom widget be wiped out every time >>> I did a "composer update" ? >>> >>> I found this to be the case when I had managed to default the form >>> submission to "formnovalidate " using a different technique under

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread Lorne Dudley
ld the custom widget be wiped out every time I >> did a "composer update" ? >> >> I found this to be the case when I had managed to default the form >> submission to "formnovalidate " using a different technique under the >> /vendor structure. >

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread euromark
. If I interpret the manual properly, I think >>> it wants me to store the custom widget under the >>> /vendor/cakephp/cakephp/src/View/Widget/ directory structure ? >>> >>> If this is correct then would the custom widget be wiped out every time >>> I

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread Lorne Dudley
a "composer update" ? >> >> I found this to be the case when I had managed to default the form >> submission to "formnovalidate " using a different technique under the >> /vendor structure. >> >> In the FormHelper.php function widget() I

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread euromark
php function widget() I added the line > unset($data['required']); // turn off HTML5 browser validation > after the line > unset($data['secure']); > > This was replace to the original (or updated) version when I did the > "composer update". > &g

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread Lorne Dudley
pdate" ? I found this to be the case when I had managed to default the form submission to "formnovalidate " using a different technique under the /vendor structure. In the FormHelper.php function widget() I added the line unset($data['required']); // turn off HTML5

Re: cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-09 Thread José Lorenzo
, January 9, 2015 at 5:28:48 AM UTC+1, Lorne Dudley wrote: > > I have finally found the method to turn off browser validation so that > cakePHP can take control of the validation instead. > > This works for me. > > Form->button(__('Submit'

cakePHP 3.0-RC1, turning off HTML5 browser validation globally on user side ???

2015-01-08 Thread Lorne Dudley
I have finally found the method to turn off browser validation so that cakePHP can take control of the validation instead. This works for me. Form->button(__('Submit'), array('formnovalidate' => true)) ?> Rather than do this for every Form, is the

Re: Validation error on "baked" date field , CakePHP 3

2015-01-08 Thread euromark
I click the Submit for the "add" function I get > > Warning (2): preg_match() expects parameter 2 to be string, array given > [CORE\src\Validation\Validation.php, line 763] > Code Context > > protected static function _check($check, $regex) > {

Validation error on "baked" date field , CakePHP 3

2015-01-08 Thread Lorne Dudley
I have a "baked" cakePHP-3.0.0 page which has a field defined as 'date_of_birth date DEFAULT NULL' in TABLE users. When I click the Submit for the "add" function I get Warning (2): preg_match() expects parameter 2 to be string, array given [CORE\src\Valid

Validation error on date field , CakePHP 3

2015-01-03 Thread Paulo Homem
'year' => '2015', 'month' => '01','day' => '02'] error : Warning (2): preg_match() expects parameter 2 to be string, array given [CORE/src/Validation/Validation.php, line 763] protected static function _check($check, $re

Custom Validation (CakePHP 3.0)

2014-12-20 Thread Alberto Domínguez
Hi all, I'm trying to enforce password definition through Model Validation rule. I would like to include a RegExp validation. Is there any simple way to do it? Should I create a validation function? Checking the sources look like there is no need, however I haven't been able to

Re: How to create a provider of validation

2014-12-01 Thread Dakota
Firstly, your Validation Provider is better situated in your src/ directory (I personally use src/Model/Validation/Provider), so the filename will be src/Model/Validation/Provider/Validation.php and the FQN will be App\Model\Validation\Provider\Validation.php Then in your ProjectValidation

How to create a provider of validation

2014-12-01 Thread Anthony GRASSIOT
well, i would say that at least you need to include your class by replacing use Cake\Validation\Validate by use Maitrepylos\Validation. then maybe you need to bind a provider as explained in the doc http://book.cakephp.org/3.0/en/core-libraries/validation.html#adding-validation-providers but I

How to create a provider of validation

2014-12-01 Thread Ernaelsten Gérard
Hello, I try to create my own validation, But I have an error of provider because I do not know what to put. //vendor/maitrepylos/Validation.php prepare($sql); $r->execute([$check]); $d = $r->fetch(\PDO::FETCH_OBJ); if($d->compteur > 0){

Re: cake3 validation in controller

2014-11-14 Thread cesar calvo
How do link the schema with Table Object? You can provide an example? I have an action "contact" in PagesController which processes the contact form: //model namespace App\Model\Table; use Cake\Database\Schema; use Cake\ORM\Table; use Cake\Validation\Validator; class PagesTable ext

Re: cake3 validation in controller

2014-11-14 Thread Florian Krämer
Create a table / model object with a schema but no table and use it as usual. The controller should be tiny and models fat. On Thursday, November 13, 2014 1:58:42 PM UTC+1, cesar calvo wrote: > > It is possible show in a form the error messages with no model

cake3 validation in controller

2014-11-13 Thread cesar calvo
It is possible show in a form the error messages with no model associated? Obviously using the Form helper. I see validating-data , but I need some guidance about the feasibility automatically display errors like w

Re: cake3 validation rule not performed

2014-11-12 Thread cesar calvo
ash->error(__('Invalid username or password.')); > } > $this->set('user', $this->Users->newEntity()); > > //view > $this->Form->create($user), > $this->Form->input('username', ['label' => __('Us

Re: cake3 validation rule not performed

2014-11-12 Thread cesar calvo
gt;input('password', ['label' => __('Password'), 'value' => false]), $this->Form->button(__('Submit')), $this->Form->end() El miércoles, 12 de noviembre de 2014 11:23:59 UTC-2, José Lorenzo escribió: > > Then use a

Re: cake3 validation rule not performed

2014-11-12 Thread José Lorenzo
Then use a validator in the controller instead of validating how data looks like in the table. Validation in the table is meant for data integrity, not so much how data looks like. On Wednesday, November 12, 2014 1:06:25 PM UTC+1, cesar calvo wrote: > > Indeed I have _setPassword in the

Re: cake3 validation rule not performed

2014-11-12 Thread cesar calvo
LOGIN form with associated model. >> ADD and EDIT actions perform validation over username but not over >> password field. >> With "ignore" I mean that the model validation rules do not apply. >> >> public function login() { >> if ($this->r

Re: cake3 validation rule not performed

2014-11-12 Thread José Lorenzo
ions perform validation over username but not over > password field. > With "ignore" I mean that the model validation rules do not apply. > > public function login() { > if ($this->request->is('post')) { > $user = $this->Auth->

Re: cake3 validation rule not performed

2014-11-12 Thread cesar calvo
The login form is very similar to that used in the blog tutorial. I can see that there is no link to the LOGIN form with associated model. ADD and EDIT actions perform validation over username but not over password field. With "ignore" I mean that the model validation rules do

Re: cake3 validation rule not performed

2014-11-12 Thread José Lorenzo
What do you mean with "the validator ignores?" What is the data that you are trying to validate and what is the result? On Tuesday, November 11, 2014 5:03:19 PM UTC+1, cesar calvo wrote: > > Hi people, I have this validation rules in UsersTable. > The validator ignores the -&g

cake3 validation rule not performed

2014-11-11 Thread cesar calvo
Hi people, I have this validation rules in UsersTable. The validator ignores the ->add(password, lenght) sentence. The issue is when I try to create or update a record. Best regards --cesar public function validationDefault(Validator $validator) { return $valida

Re: validation criteria at least 3 fileds are not empty

2014-10-28 Thread José Lorenzo
You are correct. With custom validation methods or with the validation callbacks you can extend the validation process to to more than what it is designed to do. On Tuesday, October 28, 2014 8:06:19 AM UTC+1, Radharadhya Dasa wrote: > > As I understand validation handles only one filed

Re: validation criteria at least 3 fileds are not empty

2014-10-28 Thread Radharadhya Dasa
As I understand validation handles only one filed. Am I wrong? rrd 2014. október 26., vasárnap 19:33:14 UTC+1 időpontban John Andersen a következőt írta: > > Good to see that you are trying to solve this :) > > I would still have gone with rolling my own validation, just by exte

Re: validation criteria at least 3 fileds are not empty

2014-10-26 Thread John Andersen
Good to see that you are trying to solve this :) I would still have gone with rolling my own validation, just by extending the validator, so it can validate a record also, not only fields. Anyway, I am not moving to CakePHP 3.x, so will not be able to give further ideas on that, but I do hope

Re: validation criteria at least 3 fileds are not empty

2014-10-24 Thread Radharadhya Dasa
t;request->data); debug($contact->errors()); But this is not what cake makes its automagic rules... So further digging needed. 2014. október 23., csütörtök 11:12:11 UTC+2 időpontban Radharadhya Dasa a következőt írta: > > I checked to cookbook and find out that validation handles si

Re: validation criteria at least 3 fileds are not empty

2014-10-23 Thread Radharadhya Dasa
I checked to cookbook and find out that validation handles singe fields. So I used beforeSave for this. public function beforeSave(Event $event, Entity $entity, ArrayObject $options){ if((!empty($entity->name) + !empty($entity->contactname) + !empty( $entity->zip_id)

Re: validation criteria at least 3 fileds are not empty

2014-10-18 Thread John Andersen
Assuming you are still using CakePHP 3.0 I have not seen any built-in rules for this kind of validation, so my best guess is to roll your own. See section "Custom Validation Rules" under "Validation" in the CakePHP 3.0 book. That should help you on the way. Enjoy, John On

validation criteria at least 3 fileds are not empty

2014-10-18 Thread Radharadhya Dasa
Hi, Is there a way to check if at least 3 fileds are not empty? I have 8 fileds and any of those could be empty, but at least 3 of them should be not empty. Is there any build in validation rule, or how to do it? Should I do it on beforeSave? rrd -- Like Us on FaceBook https

Re: Model Validation

2014-07-31 Thread Stephen S
& 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 >> >>

Re: Model Validation

2014-07-31 Thread Sudhir Pandey
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. Tari

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
>>> == >>> public function add(){ >>> $package = $this->Package->newEntity($this->request->data); >>> if ($this->request->is('post')) { >>> if ($this->Package->save($package)) { >

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
$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.

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
is->request->is('post')) { > if ($this->Package->save($package)) { > $this->Flash->success(__('The package has been saved.')); > return $this->redirect(['action' => 'index']); >

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
return $this->redirect(['action' => 'index']); } else{ // $errors = $this->Package->errors(); $error_string= implode('\n',$package->errors()); //print_r($package);

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
There does not seem to be any Form->create() call in that code you pasted. Can you share the full code? On Wednesday, July 30, 2014 3:20:54 PM UTC+2, Jipson Thomas wrote: > > Hi , > On my package creation form I am using cakephp validation. The validation > is working perfectly

Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
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

Re: Model Validation

2014-07-30 Thread Dr. Tarique Sani
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 wrote: > How can I perform cakephp Model validation using ajax & shows error > message. > > I have already set the

Model Validation

2014-07-30 Thread Sudhir Pandey
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->Candidateprofi

Re: CakePHP 3.0 Validation ?

2014-07-28 Thread José Lorenzo
;); >> >> >> On Monday, July 28, 2014 10:20:06 PM UTC+2, Mikaël Capelle wrote: >>> >>> Hi everyone, >>> >>> I'm trying to build a new CakePHP 3 application but I didn't manage to >>> get the data validation working... I foll

Re: CakePHP 3.0 Validation ?

2014-07-28 Thread Mikaël Capelle
>Devoirs = TableRegistry::get('Devoirs'); > > > On Monday, July 28, 2014 10:20:06 PM UTC+2, Mikaël Capelle wrote: >> >> Hi everyone, >> >> I'm trying to build a new CakePHP 3 application but I didn't manage to >> get the data validation working.

Re: CakePHP 3.0 Validation ?

2014-07-28 Thread José Lorenzo
;Devoirs'); On Monday, July 28, 2014 10:20:06 PM UTC+2, Mikaël Capelle wrote: > > Hi everyone, > > I'm trying to build a new CakePHP 3 application but I didn't manage to get > the data validation working... I followed the CakePHP 3.0 book, and > particulary th

CakePHP 3.0 Validation ?

2014-07-28 Thread Mikaël Capelle
Hi everyone, I'm trying to build a new CakePHP 3 application but I didn't manage to get the data validation working... I followed the CakePHP 3.0 book, and particulary this page http://book.cakephp.org/3.0/en/tutorials-and-examples/blog/part-two.html but it didn't help. Curr

Re: Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-17 Thread seba
Thanks very much Stephen. I kept at it and found the solution lay in removing the 'required' and 'allowEmpty' from the 'needOne' ruleset, and adding a 'required' => false in the view. Here's the working solution for any one else with this problem: The model: public $validate = array( 'last_na

Re: Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-15 Thread Stephen S
You can try dynamically adding or removing validation rules in your custom 'checkOne' method. http://book.cakephp.org/2.0/en/models/data-validation.html#removing-rules-from-the-set On 15 July 2014 15:44, seba wrote: > Folks, > > I'm trying to ensure at least one of

Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-15 Thread seba
Folks, I'm trying to ensure at least one of two fields (last_name or email) is being populated. Each field also has multiple rules. I'm using CakePHP version 2.4.2. The problem I have at the moment, after multiple permutations of updating and/or moving around the use 'last', 'allowEmpty', 're

Re: callback succession / why afterValidate() if validation fails

2014-05-26 Thread Charles Bueche
Thx José for the explanation. But how do I test if the validation has failed ? Something like this is not really nice... function afterValidate($options) { if (!empty($this->validationErrors)) { return false; } } any better idea ? TIA, Charles On 26.05.14

Re: callback succession / why afterValidate() if validation fails

2014-05-26 Thread José Lorenzo
It is just the way it works. There are equal amount of reasons for wanting the callback to be run after the validation has failed, can you not change the logic to check if there are any validation errors and not run the rest of the method? On Monday, May 26, 2014 10:06:50 AM UTC+2, cbueche

callback succession / why afterValidate() if validation fails

2014-05-26 Thread Charles Bueche
Dear Bakers, I have an app under CakePHP 2.5.1. I'm not sure to understand how the callback succession is supposed to work, eg if the validation fails, there is IMHO no reason to run afterValidate() ? But it does run indeed. What I'm trying to do: my form has 7 entry fields. The o

Re: V3.0 Custom validation messages

2014-03-18 Thread Dr. Tarique Sani
ds. The second option will be really cool to have. Thanks for your efforts Regards Tarique On Tue, Mar 18, 2014 at 7:10 PM, José Lorenzo wrote: > Tarique, I recently pushed some changes to the validation. You can now do: > > $validator->allowEmpty('my_field', false, '

Re: V3.0 Custom validation messages

2014-03-18 Thread José Lorenzo
Tarique, I recently pushed some changes to the validation. You can now do: $validator->allowEmpty('my_field', false, 'My Custom message'); This deprecates the use of the 'notEmpty' rule. On Friday, March 14, 2014 12:55:58 PM UTC+1, Dr. Tarique Sani wrote

Re: Custom MM:SS Time Validation with Regex

2014-03-14 Thread Justin Atack
e regular expressions =) > > e.g. write a validation function like so: > > function validateTime($check) { > $string = current($check); > list($mins, $seconds) = expode(':', $string); > > $validMins = is_numeric($mins); >

Re: V3.0 Custom validation messages

2014-03-14 Thread Dr. Tarique Sani
Thanks a lot José, would be interesting to compare what you do with what I was going to do :) Cheers Tarique On Fri, Mar 14, 2014 at 3:07 PM, José Lorenzo wrote: > Tarique, I can confirm the problem. It is actually an overlook on how the > validation system works now I will implemen

  1   2   3   4   5   6   7   8   9   10   >