RE: my happiness!

2010-09-04 Thread Sohei Okamoto
My apologies to everyone who got the following spam message. My account got compromised somehow. I hope it didn't cause any trouble to anyone, and it won't happen again (changed password). I'm really sorry about this. Thank you very much. Sohei -Original Message- From: Sohei Okamoto

my happiness!

2010-09-03 Thread Sohei Okamoto
Dear friend, A good news for you! I bought a laptop from Frioffere. Luckily, I was one of their first 100 customers that day, so they sold it to me at half price. Only 5 days later, I received my laptop. It is really high-quality. Same products, much lower prices! Share my happiness quickly. Come

Re: Multiple select selected attributes

2006-10-06 Thread Sohei Okamoto
The array constructed by selectTag after submit contains keys as its values, so I believe you can just array_flip() that array for next time, which will have keys as its keys. No need to change the helper. Hope this helps. Sohei --~--~-~--~~~---~--~~ You

Re: Trimming posted data

2006-10-04 Thread Sohei Okamoto
First of all, $data is a local variable, so it won't change anything in invalidFields(). Second, even if you modify $this-data, it will not be used in invalidFields(). In the code below, after first if (empty($data)), there is passed data or copy of $this-data. Then at if (!empty($data)), $data

Re: Validation problem

2006-10-02 Thread Sohei Okamoto
In beforeSave(), before returning false, you can do$this-invalidate($field_name);To me, beforeValidate() seems a little more logical place to put that, though.Hope it works for you.Sohei --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: process multiple selected rows

2006-09-29 Thread Sohei Okamoto
If each row corresponds to the data from model which has id field, maybe I would make each checkbox with the row's id as its value,then you will receive the array with selected rows' id.Am I missing anything? Hope this helps.Sohei --~--~-~--~~~---~--~~ You received

Re: Where is the correct place to put this...

2006-09-28 Thread Sohei Okamoto
Like other people said, if you already have data set, count($comments) would be good.If you are only interested to the count and not having the data, then I would do$num_comment = $this-Comment-findCount(array(post_id = $post_id)); $this-set(num_comment, $num_comment);For the formatting functions,

Re: Html helper emits id attribute that i don't want

2006-09-18 Thread Sohei Okamoto
[EMAIL PROTECTED] If it is really causing some problem or bothers you, but you still want to use Html helper,why not write a simple wrapper helper that strip out id attribute when you don't specify? class HtmlwrapperHelper extends Helper { var $helpers = Array(Html); function input($fieldName,

Re: Html helper emits id attribute that i don't want

2006-09-18 Thread Sohei Okamoto
Sorry, I accidentally sent in the middle.But anyway, do some checking on attributes and preg_replace the output from the Html helper.Would that be a bad practice, or fine approach in Cake?Sohei --~--~-~--~~~---~--~~ You received this message because you are

Re: Copying a db record

2006-09-15 Thread Sohei Okamoto
What is your debug level? Can you turn it to higher and see if there is any warning?I haven't discovered exact cause yet, but I had some problem with excuting same page twicewhen there is session warning about sending header. Just in case.Sohei

Re: cascading deletes.

2006-09-07 Thread Sohei Okamoto
If you are using same version of CakePHP as me (latest one:1.1.7.3363),then the error at line 1019 is with foreach and $records not being an array.$records = $model-findAll($field = '$id', $model-primaryKey, null, null); foreach($records as $record) {

Re: selectTag ?empty optiont?

2006-09-07 Thread Sohei Okamoto
The showEmpty option is true by default.?php echo $html-selectTag('File/category_id', $cats, null, null, null, false); ?It is in API http://api.cakephp.org/class_html_helper.html#0a0a7c56c21b7d7352fd99158350dfc5Sohei --~--~-~--~~~---~--~~ You received this message

Re: Composit forms for composit models

2006-09-06 Thread Sohei Okamoto
Unfortunately, I don't think there is an easy solution for that.However, If you have some sort of custom validation to assert the error, for example in the controller,if( empty($this-data['Person']['Address']['address1']) ) $this-Person-validationErrors['Address']['address1'] = 1;then you can make

Re: reading table from a component

2006-09-06 Thread Sohei Okamoto
I am not sure exactly what is your intention, but isn't the problem using same name for Model and Component?Either reference must be overwritten in controller.Also, if you want to access to model and/or set data for view, it should be done through controller, I believe.So, in component, it should

Re: Pagination using multiple models and custom queries

2006-09-06 Thread Sohei Okamoto
I haven't tried this yet, but I think this is what you are looking for.http://wiki.cakephp.org/tutorials:pagination It looks promising.Sohei --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Composit forms for composit models

2006-09-05 Thread Sohei Okamoto
>From what I understand, HTML helper explodes the input name by slash, and takes the first one as model and second one as field name. The rest of the name is ignored. Then make the onput tag by input name=data[%s][%s] %s/ where first %s is model name, second is field name, and the last one is the