How to validate if associated Model exists when saving

2015-01-27 Thread JP
Suppose I have an 'Order' model associated with the 'Customer' model. class Order { var $belongsTo = array('Customer');} Is there a standard way in CakePHP to validate if the record pointed to by the customer_id field exists? $this->Order->create(); $this->Order->set('customer_id', 1); $th

Re: Using 2.2.0-RC2 dynamic validation API from the Controller

2012-06-27 Thread JP
I got the same problem, but I made it globaly for captcha: // AppModel.php function addCaptchaValidation($result){ $this->validator() ->add('Captcha', 'notEmpty', array( 'rule' => 'notEmpty', 'required' => true, 'message' => 'form

Re: Design Question to Ponder

2008-02-01 Thread JP
pen too frequently. Best, JP On Jan 31, 3:23 pm, kiger <[EMAIL PROTECTED]> wrote: > Like you stated, I am saving the data to both the users table and the > cake-defined sessions table. You pretty much hit on exactly what I am > doing, and the majority of the code I want to extract f

Re: Design Question to Ponder

2008-01-31 Thread JP
this- >Session in the User model. All in all I think you only need the cart data once in the and let cake handle the session. In this case however I don't see why you need to merge session data on login. It's already saved on the users table and a new session should be created on logi

Re: Fatal error: Call to undefined method FormHelper::create()

2008-01-30 Thread JP
://tempdocs.cakephp.org/ Best, JP On 30 Jan., 15:15, mike_solomon <[EMAIL PROTECTED]> wrote: > Sorry should have said > > I installed the stable version 1.1.19.6305 > > On Jan 30, 2:11 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > On Jan 30, 2008 8:33

Re: Changing the structure of a form

2008-01-30 Thread JP
the server generate it. function addNewInput(attrString) { inputList = document.getElementById('inputList'); if (inputList) { inputList.innerHTML += '<p><input ' + attrString + '/></p>'; } }

Re: echo within a echo

2008-01-30 Thread JP
However, as United mentioned, be careful to provide this functionality for obvious security reasons. Best, JP On 30 Jan., 08:10, Unite <[EMAIL PROTECTED]> wrote: > Hey, was wondering if anyone can help me. > I have code from a database that uses mixed PHP and HTML. When I try >

Re: echo within a echo

2008-01-29 Thread JP
Try to store the return value of the $html->checkbox call: $checkboxOutput = $html->checkbox("User/news"); $saveToDB = ''. $checkboxOutput.' (Tick for yes)'; Then save the value of $saveToDB to the database. jp On 30 Jan., 08:10, Unite <[EMAIL PROTECTED]

Re: findAll with OR, AND, and BETWEEN

2008-01-29 Thread JP
regarding complex find conditions. The idea behind this is to supply conditions in polish / prefix notation where the operator precedes the arguments, to facilitate tree- like representation. http://en.wikipedia.org/wiki/Polish_notation Best, jp On 30 Jan., 05:43, brandags <[EMAIL PROTECTED]&g

Re: How to get a Helper and a Component reuse the same code?

2008-01-22 Thread JP
views, helpers, controllers, components etc. you can now just do: uses_mylib('translator', 'global_utils'); and the corresponding files will be required thus making their functionality ready to use. This is similar to cakes uses function in /cake/basics.php. Cheers, JP O

Re: How to get a Helper and a Component reuse the same code?

2008-01-22 Thread JP
tils'); And the functionality is at your service similar to the uses function of cake. Cheers, jp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cak

Re: The bakery is borked...

2008-01-22 Thread JP
works for me.., maybe a temporary problem? On Jan 22, 1:43 pm, Mech7 <[EMAIL PROTECTED]> wrote: > No articles work anymore ? > > http://bakery.cakephp.org/articles/view/bindable-behavior-control-you... > > The Article could not be found > > Its the same with every other article.. --~--~-

Re: The bakery is borked...

2008-01-22 Thread JP
works for me.., maybe a temporary problem? On 22 Jan., 13:43, Mech7 <[EMAIL PROTECTED]> wrote: > No articles work anymore ? > > http://bakery.cakephp.org/articles/view/bindable-behavior-control-you... > > The Article could not be found > > Its the same with every other article.. --~--~-~

Re: How to get a Helper and a Component reuse the same code?

2008-01-22 Thread JP
views, helpers, controllers, components etc. you can now just do: uses_mylib('translator', 'global_utils'); and the corresponding files will be required thus making their functionality ready to use. This is similar to cakes uses function in /cake/basics.php. Cheers, JP O

Re: creating and viewing an image database

2006-08-07 Thread JP
proach, but is it safe? would a non-picture file be able to still be uploaded to the temp directory, and will it be able to execute if it was mailicous? when should i read the file content into the database, and when would a malicous piece of code be executed if it was uploaded sucessfully? would

creating and viewing an image database

2006-08-05 Thread JP
uploads (https://cakebaker.wordpress.com/2006/04/15/file-upload-with-cakephp/) and have a much better grasp of that now, but how do I output the blob data stored in the database as an image in a view? Cheers, JP --~--~-~--~~~---~--~~ You received this message