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);

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' =

Re: Design Question to Ponder

2008-01-31 Thread JP
. 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 login. Best, JP On Jan 31, 3:25 am, kiger [EMAIL

Re: echo within a echo

2008-01-30 Thread JP
which eval assumes. 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: Changing the structure of a form

2008-01-30 Thread JP
=inputList pinput type=file//p /div p ? $attributes = htmlentities('type=file name=data[Model][field]'); ? a href= onClick=addNewInput('?=$attributes?');return false;add input field/a /p /body Best, JP On 30 Jan., 13:11, Flawe [EMAIL PROTECTED] wrote: I was wondering how one could achieve

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 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have

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 = 'td width=237span class=stylebody'. $checkboxOutput.' (Tick for yes)/span/td'; 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
. 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] wrote: Hello, I'm trying to generate a query

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
, components etc. you can now just do: code uses_mylib('translator', 'global_utils'); /code 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 On Jan 21, 3:54 pm, [EMAIL PROTECTED] [EMAIL

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

2008-01-22 Thread JP
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 cake-php@googlegroups.com To unsubscribe from this group, send email

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

2008-01-22 Thread JP
, components etc. you can now just do: code uses_mylib('translator', 'global_utils'); /code 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 On Jan 21, 3:54 pm, [EMAIL PROTECTED] [EMAIL

Re: creating and viewing an image database

2006-08-07 Thread JP
? 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 it be when the image was viewed again? Sorry for all the questions! Cheers, JP --~--~-~--~~~---~--~~ You received

creating and viewing an image database

2006-08-05 Thread JP
://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 because you