Re: Custom empty value for selectTag

2006-12-04 Thread shanlalit

in place of $levelID, in the form use  (array('' => 'Select level') +
$levelID) :)


--~--~-~--~~~---~--~~
 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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom empty value for selectTag

2006-04-27 Thread kain

I use this:

$array_prezzi = $this->Cost->generateList('Cost.contract_id =
"'.$contract_id.'"', 'id ASC');
if (is_array($array_prezzi)) {
$this->set('prezzi', array('' => 'TUTTI') + 
$array_prezzi);
} else {
$this->set('prezzi', array('' => 'TUTTI'));
}


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Custom empty value for selectTag

2006-04-26 Thread nate

If you read the API, you'll notice that the last parameter in selectTag
is called $showEmpty.  In the code above, you have it set to true.
What do you suppose that does?


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Custom empty value for selectTag

2006-04-26 Thread saavedrajj

thanks but doesn't work:

I have this in my controller:

$this->set('levelID', am(array(0 => 'Select a Level')),
$this->User->Level->generateList( null, "name_en ASC"));

and only view shows:

selectTag('User/level_id', $levelID, null, null,
$html->tagValue('User/level_id'), true);?>


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Custom empty value for selectTag

2006-04-25 Thread nate

No, you'd have to add it as an array element manually, but it would not
be hard; i.e. (in your controller):

$this->set('options', am(array(0 => 'Select a Level'),
$this->Model->generateList($listConditions)));


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Custom empty value for selectTag

2006-04-25 Thread saavedrajj

There's a way to asign a name and a value
for the empty value of a salecTag?

for example:


  Select a Level // <-- CUSTOM EMPTY
VALUE
  Administrator
  Editor
  Guest
  Regular


I considered put this value on the related table, but isn't elegant.


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---