xml tag with one attribute and one value

2012-11-01 Thread kevin.ncbible
Hello ... and thank you so very much for assisting!

The core libraries > utilities > xml documentation seems to imply that I 
can return the value of a tag's text by using '@' as the key. See 
following, straight from the documentation:

===

 array(
'@id' => 1,
'name' => 'Name of project, as tag',
'@' => 'Value of project'
)
);
$xmlObject = Xml::fromArray($xmlArray);
$xmlString = $xmlObject->asXML();
The content of $xmlString will be:


Value of projectName of project, as 
tag

===

This is definitely what I would like to do, but whenever I use '@' as a 
key, I get a major page full of errors.

I would like to return something like: Value of 
project (with no child tags)

In fact, and this is probably a different issue, I would really like to 
return: 


Value of project
Value of project
Value of project
Value of project


Again, thank you!!!

Kevin

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Autocomplete field to populate a select input example?

2012-11-01 Thread franscelstain
Can you show a complete script to me because I was a beginner and I want to 
learn

Pada Selasa, 03 Juli 2012 14:51:08 UTC+7, Michael menulis:
>
> I got it working. Thanks.
>
> On Tue, Jul 3, 2012 at 12:37 AM, Борислав Събев 
> 
> > wrote:
>
>> Hi there.
>>
>> I am assuming that you've got he autocomplete working. So what you 
>> basically need to do is to make an ajax call to retrieve all cities in that 
>> state once it is entered.
>> The ajax call should call some controller method that searches for and 
>> returns the cities (in the selected state) in json for example. Once it has 
>> completed you populate the select box. 
>> You will need to do this on every change of the "State" field.
>>
>>
>> On Monday, 2 July 2012 16:39:05 UTC+3, Michael wrote:
>>>
>>> So I have an auto-complete field where you can type in the name of a 
>>> state, and once it fills in the field, I want it to show another select 
>>> input which is populated by all the cities in that state. Does anyone have 
>>> a link to a tutorial or example of this? It will save me having to hack it 
>>> together. Thanks
>>>
>>>
>>> ~Michael
>>>
>>  -- 
>> 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+u...@googlegroups.com  For more options, visit 
>> this group at http://groups.google.com/group/cake-php
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




cakephp with jquery datatable

2012-11-01 Thread Panda Taruma
iI am using jquery datatable. successfully .. 
but the data show a maximum of 100 rows.. anybody can share to me??

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Tutorial Problem

2012-11-01 Thread tommyd456
Hi All
I've been going through the Blog tutorial and hit a problem that many 
people seem to be getting. When I navigate to localhost:/posts/view I 
get the following errors:


I have not made the usual mistake of cpt rather than ctp as a file 
extension. I am using MAMP. Does anyone know if I need to look into the 
MOD_REWRITE settings?

Any help would be much appreciated.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




how can i migrate from cakephp 1.2 to 2.x...?

2012-11-01 Thread Ankur Pandit
is it necessary to migrate to 1.3 first from 1.2 and than to 2.x...? kindly 
provide links or ways to help me out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CakePHP 2.x and ajax

2012-11-01 Thread franscelstain
is there someone who can teach me to use ajax in cakephp 2.x, because I am 
still very novice

thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




I do not get an Error but only a "The connection was reset"

2012-11-01 Thread fernando menendez
Hi

I have this line of code in my XXXController.php :

$this->request->data['Picture']['filename'] = $this->data['User']['ID'] + 
'_' + $idEvento + '_' + $this->request->data['Picture']['filename'] + ;

I spent like 1 day trying to figure out, why when i run that Controller 
method just gave me an ugly browser error "The connection was reset"
so, i opened my ayes better and find out that my line of code had an extra 
"+" , damn , i just removew that extra "+" and it worked fine.
My Question is Why i did not got an error from the compiler/interpreter to 
tell me something wrong in that line?


Thanks in advance

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Many-to-many ACL

2012-11-01 Thread Daniel Hdez
Hello, hey i have the same problem, do you find a solution yet? greetings! 
:)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




How to pass HABTM validation errors to FormHelper?

2012-11-01 Thread Nvp
Hi!
I read many topics about HABTM validation in Cake but I can't figure out 
how to solve my problem.

I have my main model – Restaurants, it has many HABTM relations to 
additional models.
Now I'm building admin area, and I'm working with new controller in which I 
have

public $uses = array('Restaurant');

This admin area controller have an edit action: 
 
... else {
if ($this->Restaurant->save($this->request->data)) {
$this->Session->setFlash('Ok!');
$this->redirect(array('action' => 'edit', $id));
} else {
$this->Session->setFlash('Error');   
$this->redirect(array('action' => 'edit', $id));
}
}

In my Restaurant model I have:

function beforeValidate() {  
foreach($this->hasAndBelongsToMany as $k=>$v) {
if(isset($this->data[$k][$k]))
{
$this->data[$this->alias][$k] = $this->data[$k][$k];
}
 }
}
I can't comment this code because it's from HABTM validation guide.

And also in Restaurant model I have some validation rules:

var $validate = array(
'engcompanyname' => array(
'rule' => 'notEmpty',
'message' => 'Test message'
)
);

In edit.ctp I have standard form builded with FormHelper:

 Form->create(); 
...
echo $this->Form->input('engcompanyname', array('label' => 'Test 
label'));
...
echo $this->Form->end(array('label' => 'Save');
?>

The problem is that validation itself works very well, I got my session 
message back for success and error conditions, the data from the form 
correctly passes to database etc.  But FormHelper does not show any error 
messages.

CakePHP version is 2.2.2

Thanks in advance!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Chris
thanks chetan,... ! it works ...! no empty spots,... 

On Thursday, November 1, 2012 10:04:38 AM UTC-7, chetan varshney wrote:
>
> use like this
>
> echo $this->Form->input("gender" , array('type' => 'select',  
> 'options'=>$genders))?>
>
> good luck all set
>
> On Thu, Nov 1, 2012 at 10:16 PM, Chris >wrote:
>
>> thanks chetan,... I have tried that too,... no luck,... steel having 
>> empty spots on top of options,... please  take a look of it,... 
>> http://www.hamayk.com/signup 
>>
>> I have remove 'unknown' 
>>
>>
>> On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote:
>>
>>> The logic you are trying to use it produce html as-
>>>
>>> 
>>> unknown
>>> male
>>> female
>>> 
>>>
>>> So you should use in following way-
>>>
>>> Configure::write('User.**genders', array(''=>'unknown', '1'=>'male', 
>>> '2'=>'female'));
>>>
>>> rest code is same
>>>
>>>
>>> On Thu, Nov 1, 2012 at 3:53 PM, Chris  wrote:
>>>
  
 hi guys,... I'm using cake 1.3 
 how can I validate "select" field from Model,? 

 what I have in bootstrap: 
  Configure::write('User.**genders', array('unknown', 'male', 
 'female'));

 in a view: 
  
 
 >>>  $genders = array(Configure::read('User.**genders')); 
 echo $this->Form->select('gender', $genders) 
  ?>
 
  

 and in a Model: 
   var $validate = array(
  'gender' => array(
   'rule' => 'notEmpty',
   'required' => true,
   'message' => 'Gender must be valid',
  ),
   );

 I'm not getting warning of red box with "Gender must be valid" 

 how can I do this? 

 thanks in advance 
 chris 

  -- 
 Like Us on FaceBook 
 https://www.facebook.com/**CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google 
 Groups "CakePHP" group.
 To post to this group, send email to cake...@googlegroups.com.
 To unsubscribe from this group, send email to cake-php+u...@**
 googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/cake-php?hl=en
 .
  
  

>>>
>>>
>>>
>>> -- 
>>> Chetan Varshney
>>> Ektanjali Softwares Pvt Ltd
>>>
>>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> cake-php+u...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
>>
>
>
>
> -- 
> Chetan Varshney
> Director
> Ektanjali Softwares Pvt Ltd
> Delhi India
> Mobile: 91 9891538749 | Email: chetanv...@gmail.com  | 
> Skype: chetan-varshney
> EktaSoftwares.Com
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
use like this

echo $this->Form->input("gender" , array('type' => 'select',
'options'=>$genders))?>

good luck all set

On Thu, Nov 1, 2012 at 10:16 PM, Chris  wrote:

> thanks chetan,... I have tried that too,... no luck,... steel having empty
> spots on top of options,... please  take a look of it,...
> http://www.hamayk.com/signup
>
> I have remove 'unknown'
>
>
> On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote:
>
>> The logic you are trying to use it produce html as-
>>
>> 
>> unknown
>> male
>> female
>> 
>>
>> So you should use in following way-
>>
>> Configure::write('User.**genders', array(''=>'unknown', '1'=>'male',
>> '2'=>'female'));
>>
>> rest code is same
>>
>>
>> On Thu, Nov 1, 2012 at 3:53 PM, Chris  wrote:
>>
>>>
>>> hi guys,... I'm using cake 1.3
>>> how can I validate "select" field from Model,?
>>>
>>> what I have in bootstrap:
>>>  Configure::write('User.**genders', array('unknown', 'male', 'female'));
>>>
>>> in a view:
>>>  
>>> 
>>> >>  $genders = array(Configure::read('User.**genders'));
>>> echo $this->Form->select('gender', $genders)
>>>  ?>
>>> 
>>>  
>>>
>>> and in a Model:
>>>   var $validate = array(
>>>  'gender' => array(
>>>   'rule' => 'notEmpty',
>>>   'required' => true,
>>>   'message' => 'Gender must be valid',
>>>  ),
>>>   );
>>>
>>> I'm not getting warning of red box with "Gender must be valid"
>>>
>>> how can I do this?
>>>
>>> thanks in advance
>>> chris
>>>
>>>  --
>>> Like Us on FaceBook 
>>> https://www.facebook.com/**CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To post to this group, send email to cake...@googlegroups.com.
>>> To unsubscribe from this group, send email to cake-php+u...@**
>>> googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/cake-php?hl=en
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Chetan Varshney
>> Ektanjali Softwares Pvt Ltd
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
Chetan Varshney
Director
Ektanjali Softwares Pvt Ltd
Delhi India
Mobile: 91 9891538749 | Email: chetanvarsh...@gmail.com | Skype:
chetan-varshney
EktaSoftwares.Com

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Chris
thanks chetan,... I have tried that too,... no luck,... steel having empty 
spots on top of options,... please  take a look of it,... 
http://www.hamayk.com/signup 

I have remove 'unknown' 


On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote:
>
> The logic you are trying to use it produce html as-
>
> 
> unknown
> male
> female
> 
>
> So you should use in following way-
>
> Configure::write('User.genders', array(''=>'unknown', '1'=>'male', 
> '2'=>'female'));
>
> rest code is same
>
>
> On Thu, Nov 1, 2012 at 3:53 PM, Chris >wrote:
>
>>
>> hi guys,... I'm using cake 1.3 
>> how can I validate "select" field from Model,? 
>>
>> what I have in bootstrap: 
>>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>>
>> in a view: 
>>  
>> 
>> >  $genders = array(Configure::read('User.genders')); 
>> echo $this->Form->select('gender', $genders) 
>>  ?>
>> 
>>  
>>
>> and in a Model: 
>>   var $validate = array(
>>  'gender' => array(
>>   'rule' => 'notEmpty',
>>   'required' => true,
>>   'message' => 'Gender must be valid',
>>  ),
>>   );
>>
>> I'm not getting warning of red box with "Gender must be valid" 
>>
>> how can I do this? 
>>
>> thanks in advance 
>> chris 
>>
>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> cake-php+u...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
>>
>
>
>
> -- 
> Chetan Varshney
> Ektanjali Softwares Pvt Ltd
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Chris
hi jsundquist,... 
in fact I'm getting an 2 empty spots on top with no options empty,... what 
if the new user who's trying to signup accidentally deselect it ? ,... and 
there we need the red wrapping warning with message,...  'message' => 
'Gender must be valid',... anyway,... for now I'm validating from a 
controller but will be nice to do it from Model,... 

elseif(empty($this->data['User']['gender']))
{
  $this->flash('error', ucfirst(i18n::translate('you must enter 
valid Gender')));
  $this->redirect($_SERVER['HTTP_REFERER']);
}

thanks man,... 


On Thursday, November 1, 2012 5:13:48 AM UTC-7, jsundquist wrote:
>
> A select dropdown will never be empty unless one of the options is an 
> empty string.
>
> - Jon
> On Nov 1, 2012 5:23 AM, "Chris" > wrote:
>
>>
>> hi guys,... I'm using cake 1.3 
>> how can I validate "select" field from Model,? 
>>
>> what I have in bootstrap: 
>>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>>
>> in a view: 
>>  
>> 
>> >  $genders = array(Configure::read('User.genders')); 
>> echo $this->Form->select('gender', $genders) 
>>  ?>
>> 
>>  
>>
>> and in a Model: 
>>   var $validate = array(
>>  'gender' => array(
>>   'rule' => 'notEmpty',
>>   'required' => true,
>>   'message' => 'Gender must be valid',
>>  ),
>>   );
>>
>> I'm not getting warning of red box with "Gender must be valid" 
>>
>> how can I do this? 
>>
>> thanks in advance 
>> chris 
>>
>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> cake-php+u...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Installing an existing site locally on MAMP

2012-11-01 Thread Neil Berrow
Followed these directions but it's not working, it may be the .htaccess 
file, can you upload a copy so I can see if it is that.

Thanks for your help!
Neil

On Thursday, October 4, 2012 7:31:39 AM UTC+2, Michael Connors wrote:
>
> Make a directory somewhere on your drive, say its 
> /user/me/projects/site. Download and unzip cakephp and put its contents in 
> that folder site.
>
> open MAMP/conf/apache/httpd.conf
>
> add a virtual host at the bottom
>
> 
> DocumentRoot "*/user/me/projects/site/app/webroot*"
> ServerName *mysite.local*
> RewriteEngine on
> 
> AllowOverride All
> Order deny,allow
> Allow from All
> 
> 
>
> Open a terminal and edit host file
>
> sudo vi /etc/hosts
>
> add the line 
> *127.0.0.1 *  *mysite.local*
>
> Restart MAMP. You should be able to open a browser and go to *
> http://mysite.local *and use that as a working directory. From there go 
> through the instructions if there are errors, you will most likely have to 
> add .htaccess files. I also highly recommend get a git account somewhere 
> and commit your files to git.
>
>
>
> On Wednesday, October 3, 2012 5:07:03 AM UTC-4, Neil Berrow wrote:
>>
>> Hi
>>
>> I've searched and searched but all I can find is how to install a Cake 
>> environment from scratch locally on a mac.
>>
>> I have an existing site which my developer built for me months ago, I'm 
>> no Cakephp programmer but I have basic php skills.
>>
>> Can anyone suggest where I can get info from or if they've been in the 
>> same boat?
>>
>> Any help will be much appreciated!
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
The logic you are trying to use it produce html as-


unknown
male
female


So you should use in following way-

Configure::write('User.genders', array(''=>'unknown', '1'=>'male',
'2'=>'female'));

rest code is same


On Thu, Nov 1, 2012 at 3:53 PM, Chris  wrote:

>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>  
> 
>   $genders = array(Configure::read('User.genders'));
> echo $this->Form->select('gender', $genders)
>  ?>
> 
>  
>
> and in a Model:
>   var $validate = array(
>  'gender' => array(
>   'rule' => 'notEmpty',
>   'required' => true,
>   'message' => 'Gender must be valid',
>  ),
>   );
>
> I'm not getting warning of red box with "Gender must be valid"
>
> how can I do this?
>
> thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
A select dropdown will never be empty unless one of the options is an empty
string.

- Jon
On Nov 1, 2012 5:23 AM, "Chris"  wrote:

>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>  
> 
>  $genders = array(Configure::read('User.genders'));
> echo $this->Form->select('gender', $genders)
> ?>
> 
>  
>
> and in a Model:
>   var $validate = array(
>  'gender' => array(
>   'rule' => 'notEmpty',
>   'required' => true,
>   'message' => 'Gender must be valid',
>  ),
>   );
>
> I'm not getting warning of red box with "Gender must be valid"
>
> how can I do this?
>
> thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
- Jon
On Nov 1, 2012 5:23 AM, "Chris"  wrote:

>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>  
> 
>  $genders = array(Configure::read('User.genders'));
> echo $this->Form->select('gender', $genders)
> ?>
> 
>  
>
> and in a Model:
>   var $validate = array(
>  'gender' => array(
>   'rule' => 'notEmpty',
>   'required' => true,
>   'message' => 'Gender must be valid',
>  ),
>   );
>
> I'm not getting warning of red box with "Gender must be valid"
>
> how can I do this?
>
> thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




validate select field in a Model

2012-11-01 Thread Chris

hi guys,... I'm using cake 1.3 
how can I validate "select" field from Model,? 

what I have in bootstrap: 
 Configure::write('User.genders', array('unknown', 'male', 'female'));

in a view: 
 

Form->select('gender', $genders) 
?>

 

and in a Model: 
  var $validate = array(
 'gender' => array(
  'rule' => 'notEmpty',
  'required' => true,
  'message' => 'Gender must be valid',
 ),
  );

I'm not getting warning of red box with "Gender must be valid" 

how can I do this? 

thanks in advance 
chris 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.