FormHelper custom label overriding inputDefaults

2011-05-24 Thread Tomek Mazur
Hi, I have a form started like this:

?php echo $this-Form-create('Transaction',array(
 
'url'=array('controller'='transactions','action'='data')
,'inputDefaults'=array(
'label'=array(
'class'='bd-label'
),'div'=array(
'class'='bd-div'
),'class'='bd-input'
)
)); ?

Each label, div and input is given a custom class. However i want to
change the label of one of the inputs. I have tried two options:

echo $this-Form-input('name',array('label'='not really a name'));

and

echo $this-Form-input('name',array('label'=array('text'='not
really a name')));

Each of these however results in a a label without the bd-label class.
Doing this will obviously solve the problem:

echo $this-Form-input('name',array('label'=array('text'='not
really a name','class'='bd-label')));

but perhaps there is a cleaner solution? I have a lot of inputs with
custom labels in this form. Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Internal Error 500 with debug 0

2010-09-04 Thread Tomek Mazur
Problem solved. Details on my blog:
http://tomaszmazur.eu/artykul/44-CakePHP-IdeaCache-Internal-Server-Error-500

For non-polish readers, the reason for this in my case is something
called IdeaCache. To solve this problem i had to hack the core,
replacing a few lines in /cake/libs/cake_log.php

from

if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) {
set_error_handler(array('CakeLog', 'handleError'));
}

to

if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) {
$cakeLog = CakeLog::getInstance();
set_error_handler(array($cakeLog, 'handleError'));
}

Tickets for this have already been filed.
http://cakephp.lighthouseapp.com/projects/42648/tickets/923

On 30 Sie, 13:14, Tomek Mazur tmazu...@gmail.com wrote:
 Hello,

 I have this problem after moving my app to the production server. If I
 have debug = 1 or debug = 2 everything works ok. If I switch debug to
 0 I get an Internal Error 500. I should add that everything works fine
 on localhost, no matter what the debug is. Maybe someone can point me
 in the direction i should be looking? I read about changing
 RewriteBase in .htaccess but that doesnt seem to work.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Internal Error 500 with debug 0

2010-08-30 Thread Tomek Mazur
Hello,

I have this problem after moving my app to the production server. If I
have debug = 1 or debug = 2 everything works ok. If I switch debug to
0 I get an Internal Error 500. I should add that everything works fine
on localhost, no matter what the debug is. Maybe someone can point me
in the direction i should be looking? I read about changing
RewriteBase in .htaccess but that doesnt seem to work.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


complicated relation

2010-07-12 Thread Tomek Mazur
Hi guys,

I could use some help with the complicated relation I am trying to
create. I have 2 tables: ingredients and units. One ingredient can
have many units(HABTM relation). This creates a `ingredients_units`
table with the fields:

-ingredient_id
-unit_id
-ammount

But the problem is, that if an ingredient has many units I have to
somehow be able to convert between each unit. The complication is that
the calculations from one unit to another depend on the ingredient. So
the table I am wanting to create has to have the following fields:

-ingredient_id
-unit1_id
-unit2_id
-conversion_number

Is there a way I can create such a relation with Cake? Or do I have to
stick to my own SQL? I'll be thankful for any response. ;)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread Tomek Mazur
I suppose adblock i blocking that content. Try turning it off and see
if it works.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Form always validates on 1.3 beta

2010-02-11 Thread Tomek Mazur
Yeah, that's it. :) Now I feel kind of ashamed for making this thread,
but I guess it was the only way to figure this out. I was searching
too deep. Thank you.

On 10 Lut, 05:05, Dr. Loboto drlob...@gmail.com wrote:
 Check this model filename. Should be post_comment.php. This model may
 be not loaded at all if you named it wrong. In this case $this-PostComment 
 in controller will be of class AppModel and won't have

 your validation rules, of course.

 On Feb 9, 9:54 pm, Tomek Mazur tmazu...@gmail.com wrote:

  Nope. I tried this with other rules: minLength, maxLength and it
  always validates. It seems like the rules are simply ignored. It
  occours only in this one specific model. Don't know what's behind
  this...

  On 9 Lut, 15:49, Céryl c.a.h.wilt...@student.tue.nl wrote:

   Not sure but is there a chance that the username is an empty string
   like  or has a stray space perhaps? And therefore not considered
   empty?

   If not... Beats me! :D

   On 8 feb, 17:31, Tomek Mazur tmazu...@gmail.com wrote:

Hi,

I have this weird problem. I set up validation rules but cake seems to
ignore them. Here is my model and 
controller:http://bin.cakephp.org/view/309506151

I supply this data:
Array
(
    [PostComment] = Array
        (
            [username] =
            [email] =
            [message] =
            [post_id] = 31
        )
)

which obviously sould not validate, yet the first debug returns
'true'. This is driving me crazy, my controller is kind of 'nasty',
because I was trying to debug the problem.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Form always validates on 1.3 beta

2010-02-09 Thread Tomek Mazur
Nope. I tried this with other rules: minLength, maxLength and it
always validates. It seems like the rules are simply ignored. It
occours only in this one specific model. Don't know what's behind
this...

On 9 Lut, 15:49, Céryl c.a.h.wilt...@student.tue.nl wrote:
 Not sure but is there a chance that the username is an empty string
 like  or has a stray space perhaps? And therefore not considered
 empty?

 If not... Beats me! :D

 On 8 feb, 17:31, Tomek Mazur tmazu...@gmail.com wrote:

  Hi,

  I have this weird problem. I set up validation rules but cake seems to
  ignore them. Here is my model and 
  controller:http://bin.cakephp.org/view/309506151

  I supply this data:
  Array
  (
      [PostComment] = Array
          (
              [username] =
              [email] =
              [message] =
              [post_id] = 31
          )
  )

  which obviously sould not validate, yet the first debug returns
  'true'. This is driving me crazy, my controller is kind of 'nasty',
  because I was trying to debug the problem.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Form always validates on 1.3 beta

2010-02-08 Thread Tomek Mazur
Hi,

I have this weird problem. I set up validation rules but cake seems to
ignore them. Here is my model and controller: 
http://bin.cakephp.org/view/309506151

I supply this data:
Array
(
[PostComment] = Array
(
[username] =
[email] =
[message] =
[post_id] = 31
)
)

which obviously sould not validate, yet the first debug returns
'true'. This is driving me crazy, my controller is kind of 'nasty',
because I was trying to debug the problem.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en