Re: Pagination Sort

2010-05-04 Thread sijo jose
Well thanks for the prompt reply

I have this model Structure -

Model 1 - Union

var $belongsTo = array(
'Address' => array(
'className' => 'Address',
'foreignKey' => 'address_id',
'conditions' => '',
'fields' => '',
'order' => ''
) );


Model 2 - Address

var $belongsTo = array(
'District' => array(
'className' => 'District',
'foreignKey' => 'district_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

Model 3  District.
 with fields name and code both varchar.

Now when I paginate UNION  like this

$this->paginate = array(
'order' => array('Address.street' => 'ASC'),
);


it works fine.

What I need is the next level that is District which is related to Address,
but not to UNION

On Tue, May 4, 2010 at 1:39 PM, Andrei Mita  wrote:

> Check out the 2 links below:
> http://book.cakephp.org/view/164/Pagination
> http://book.cakephp.org/view/858/Using-Containable-with-pagination
>
>
>
> On Tue, May 4, 2010 at 11:07 AM, Andrei Mita wrote:
>
>> I believe paginate documentation in the book has a similar example.
>>
>>
>>
>> On Tue, May 4, 2010 at 9:48 AM, sijo jose  wrote:
>>
>>> Hi guys,
>>>
>>> I have this model Structure -
>>>
>>> Model 1 - Union
>>>
>>> var $belongsTo = array(
>>> 'Address' => array(
>>>  'className' => 'Address',
>>> 'foreignKey' => 'address_id',
>>>  'conditions' => '',
>>> 'fields' => '',
>>>  'order' => ''
>>> ) );
>>>
>>>
>>> Model 2 - Address
>>>
>>> var $belongsTo = array(
>>> 'District' => array(
>>> 'className' => 'District',
>>>  'foreignKey' => 'district_id',
>>> 'conditions' => '',
>>>  'fields' => '',
>>> 'order' => ''
>>> )
>>>  );
>>>
>>> Model 3  District.
>>>  with fields name and code both varchar.
>>>
>>>
>>> Now I would like to paginate the Unions which should be ordered in ASC by
>>> Union.Address.District.name ASC
>>>
>>> Is that possible and if so how should i write the paginate.
>>>
>>> Urgent help need. I am stuck here.
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>> --
>>> Sijo Jose Chakramakkil
>>>
>>> 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.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>
>  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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Sijo Jose Chakramakkil

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


Pagination Sort

2010-05-03 Thread sijo jose
Hi guys,

I have this model Structure -

Model 1 - Union

var $belongsTo = array(
'Address' => array(
'className' => 'Address',
'foreignKey' => 'address_id',
'conditions' => '',
'fields' => '',
'order' => ''
) );


Model 2 - Address

var $belongsTo = array(
'District' => array(
'className' => 'District',
'foreignKey' => 'district_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

Model 3  District.
 with fields name and code both varchar.


Now I would like to paginate the Unions which should be ordered in ASC by
Union.Address.District.name ASC

Is that possible and if so how should i write the paginate.

Urgent help need. I am stuck here.





Regards,
-- 
Sijo Jose Chakramakkil

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: VALIDATION

2009-12-07 Thread sijo jose
Hi Anand,

If you are trying to Save both user and user_phone u might be using saveAll.

So for validating just use

$this->User->saveAll('User',array('validation'=>'first'));

This will validate both your models.



On Mon, Dec 7, 2009 at 5:31 PM, anand angadi  wrote:

> Hi all,
>
> I have 2 model called User,user_phone...I have imported user_phone in User
> model...and I have done basic Add,Edit,Delete functionality...
>
> Now the problem is...
>
> In my view page I have input  fields as username,password which belongs to
> user table and one more input field as number which belongs to user_phone...
>
> I am getting validation for username and password but not getting the
> validation for number as it is in different table and model...
>
> How can I solve this...?
>
> Cheers:
> Anand
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Sijo Jose Chakramakkil

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


Email Validation

2009-10-06 Thread sijo jose
Hi folks,

I have a email field which is not mandatory. But i would like it to b
validated if at all it is entered.

Please suggest.

-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SaveAll problem?

2009-07-23 Thread sijo jose
x27;);
$lead = $this->Lead->read(null, $id);
$this->data['Registration']['first_name']
=$lead['Lead']['first_name'];
$this->data['Registration']['middle_name']
=$lead['Lead']['middle_name'];
$this->data['Registration']['last_name']
=$lead['Lead']['last_name'];

$this->data['Registration']['address_line1']
=$lead['Contact']['address_line1'];
$this->data['Registration']['address_line2']
=$lead['Contact']['address_line2'];
$this->data['Registration']['address_line3']
=$lead['Contact']['address_line3'];

$this->data['Registration']['city']
=$lead['Contact']['city'];
$this->data['Registration']['state']
=$lead['Contact']['state'];
$this->data['Registration']['country_name']
=$lead['Contact']['country_name'];

$this->data['Registration']['postal_code']
=$lead['Contact']['postal_code'];
$this->data['Registration']['primary_email']
=$lead['Contact']['primary_email'];
$this->data['Registration']['secondary_email']
=$lead['Contact']['secondary_email'];

$this->data['Registration']['mobile_number']
=$lead['Contact']['mobile_number'];
$this->data['Registration']['home_phone']
=$lead['Contact']['home_phone'];
$this->data['Registration']['office_phone']
=$lead['Contact']['office_phone'];
$this->set('leadID',$lead['Lead']['id']);
$this->set($this->data);
}
$this->Country->recursive = -1;
$this->set('countryList', $this->Country->myGenerateList(null,
null, null,'{n}.Country.id', '{n}.Country.name'));
}
}


My view is dynamic view : I am just pasting the form elements.

create('Registration', array('action' =>
'studyabroadregistration','url'=>array('controller' => 'registrations')));?>


Personal
Information


 First Name *
input('first_name', array('label' =>
'','className'=>'formInput'));
  echo $form->hidden('id');  ?>
 Middle Name
input('middle_name', array('label' =>
'','className'=>'formInput'));?>
 Last Name *
input('last_name', array('label' =>
'','className'=>'formInput'));?>


 Gender

Male
Female

 Marital Status 
input('marital_status', array('label'
=> '','type'=>'select','empty'=>'Select','options'=>array( 'married'
=>'Married', 'single' => 'Single', 'divorced' =>
'Divorced'),'className'=>'formInput'));?>


 Date Of Birth *
input('dob', array('label'
=> '','className'=>'formInput','timeFormat'=>''));?>




Educational
Summary




Course Name
Stream
Year Of Passing
University



input('EducationDetail.0.course_name',array('label'=>'','size'=>'30'));
?>
input('EducationDetail.0.stream',array('label'=>'','size'=>'30'));
?>
input('EducationDetail.0.year_of_passing',array('label'=>''));
?>
input('EducationDetail.0.university_name',array('label'=>'','size'=>'30'));
?>




  






The javascript function here adds rows of educational details row by row
with perfect numbering.

Well this part has been troubling me for some part.
What I have done wrong ? .

Please help.


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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: file validation

2009-03-03 Thread sijo jose
Well Kaushik

I have done my part of validation in controller.

The following site would be helpful in that matter
http://www.keithmedlin.com/2008/01/cakephp-12-file-upload/
http://cakebaker.wordpress.com/2006/04/15/file-upload-with-cakephp/
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

Regarding Model validation check this site but I have not work with this.
http://www.jonnyreeves.co.uk/2008/06/cakephp-uploaded-file-validation-in-models/

Regards
Sijo Jose C


On Tue, Mar 3, 2009 at 3:35 PM, kaushik  wrote:

>
> I want to set a system where file uploading is must and i also want to
> check the extension of file. Is it possible to arrange the validation
> from model or I have to check from controller.
>
> Can anyone give any idea?
> >
>

--~--~-~--~~~---~--~~
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: Session

2009-02-09 Thread sijo jose
Hi majna,

Thx for the tip. It was helpful and it works.

Regards
Sijo Jose C

On Thu, Feb 5, 2009 at 2:40 PM, majna  wrote:

>
> try with
> Configure::write('Session.checkAgent', false);
> Configure::write('Security.level', 'medium');
>
> On Feb 5, 9:26 am, Cjo  wrote:
> > Hi all,
> >
> > I have peculiar issue right now.
> >
> > When ever i double click on a link or a button, I get session out and
> > thrown out.
> >
> > Is this my configuration issue and is there any remedies.
> >
> > Can I get some help.??
> >
> > Regards
> > Sijo Jose C
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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: Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Thanks
Alexandru...
Regards
Sijo Jose C


On Wed, Jan 14, 2009 at 9:22 PM, Alexandru Ciobanu wrote:

>
> sijo jose wrote:
> > Hi all,
> >
> > I have been stuck at two places.
> >
> > 1. This is regarding User and his corresponding.
> > Actually I have a User who is assigned a Group 'xx' while he is
> > created. But at a later stage I would like to regroup him to a Group
> > 'yy'. Simply changing the User group is not working sice I think the
> > corresponding AROS is not getting updated. How would I  update the
> > AROS regarding this.
> >
> > 2. I would like to populate the database with some Users when my site
> > gets to production. This is also because AROS is not being populated.
> >
> http://book.cakephp.org/view/641/Simple-Acl-controlled-Application
>
> Everything you need it's right here.
>
> Acl behavior will help you with the updates:
> http://book.cakephp.org/view/645/Acts-As-a-Requester
>
>
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Hi all,

I have been stuck at two places.

1. This is regarding User and his corresponding.
Actually I have a User who is assigned a Group 'xx' while he is created.
But at a later stage I would like to regroup him to a Group 'yy'. Simply
changing the User group is not working sice I think the corresponding AROS
is not getting updated. How would I  update the AROS regarding this.

2. I would like to populate the database with some Users when my site gets
to production. This is also because AROS is not being populated.

Any help regarding this would be of great help.

Regards
Sijo Jose C

--~--~-~--~~~---~--~~
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: Newbie - multiple model instances in one form and validation

2008-12-24 Thread sijo jose
Hi ,

If the model associations are correct and the for is created using User
just user

$this->User->saveAll($this->data,array('validation'=>'first'))

will validate all the Models, well as I said the model associations must be
perfect.

Regards
Sijo Jose C

On Wed, Dec 24, 2008 at 4:25 PM, Nature Lover
wrote:

>
> Hi!
>
> I am new to CakePHP and currently working on an e-commerce site having
> three models:
>
> User( id, name, joined)
> UserProfile( id, user_id, title, age, email )
> UserContacts( id, user_id, name, address)
>
> Currently receiving data from a form as below:
>
> $this->data['User']['name']
> $this->data['UserProfile']['title']
> $this->data['UserProfile']['age']
> $this->data['UserProfile']['email']
> $this->data['UserContact']['0']['name']
> $this->data['UserContact']['0']['address']
> $this->data['UserContact']['1']['name']
> $this->data['UserContact']['1']['address']
>
> tried to validate data in User controller as:
>
> $this->User->set($this->data);
> $this->User->UserProfile->set($this->data);
> $this->User->UserContact->set($this->data);
>
> if($this->User->validates())
> {
>if($this->User->UserProfile->validates())
>{
>if($this->User->UserContact->validates())
>{
>$this->set('status','valid');
>}
>}
> }
> else
> {$this->set('status','invalid');}
>
> Here proper validation fails for UserContacts although showing errors
> as
> $this->validationErrors['UserContact']['fieldname']
> instead of
> $this->validationErrors['UserContact']['0']['fieldname'] and
> $this->validationErrors['UserContact']['1']['fieldname']
>
> Also tried to use saveAll with validate=only, but failed due to
> foreign key constrains as getting error:
>
> 'This field cannot be left blank'
> for
> $this->validationErrors['UserProfile']['user_id'] and
> $this->validationErrors['UserContact']['0']['user_id']
> $this->validationErrors['UserContact']['1']['user_id']
>
> Please help me to get out of this hurdle.
>
> Thanks!
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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: Saving Multiple Models in one save

2008-12-24 Thread sijo jose
Well sorry for not being prompt,

Presently cakePHP supports saving models upto level one only.
So I have changed my code accordingly.
Thanks for your reply which was helpfull.

Regards
Sijo

On Wed, Dec 10, 2008 at 2:52 PM, WebbedIT  wrote:

>
> I haven't gotten around to using saveAll() as yet, but I did spot that
> you haven't created a belongsTo relation from SamplingDetail to
> Intimation to close the hasOne/belongsTo relationship between the two
> models.
>
> Similarly best practice dictates you should create hasOne
> relationships for
>
> Processor->SamplingDetail
> Contact->Processor
>
> Not that I think this will necessarily solve your saleAll issue but it
> is good practice to do so.
>
> Without using the saveAll function myserlf I can only hazard guesses
> at what you can look at.  I tried looking for a recursive property to
> try and tell the function to go more than 1 level deep, but that
> doesn't exist.  What happens if you change the fields from
>
> input('SamplingDetail.package_description'); ?>
> input('SamplingDetail.lot_number'); ?>
> input('SamplingDetail.invoice_number'); ?>
> input
> ('SamplingDetail.Processor.Contact.firstName'); ?>
> input
> ('SamplingDetail.Processor.Contact.address'); ?>
>
> to
>
>  input('SamplingDetail.package_description'); ?>
>  input('SamplingDetail.lot_number'); ?>
>  input('SamplingDetail.invoice_number'); ?>
>  input
> ('Contact.firstName'); ?>
>  input
> ('Contact.address'); ?>
>
> The fact that Intimation model fields will save from
>
>  input('Intimiation.field1'); ?>
>
> And SamplingDetail fields will save from
>
>  input('SamplingDetail.field2'); ?>
>
> Means other related fields should save from
>
>  input('Processor.field3'); ?>
>  input('Contact.field4'); ?>
>
> Hopefully someone else can join in and clear this up ;)
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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 Developers in Chennai, TamilNadu, India?

2008-12-24 Thread sijo jose
Yah i have been working for past 4 months.

Regards
Sijo

On Thu, Dec 11, 2008 at 11:15 PM, ravindranathbe
wrote:

>
> Hi
> I am Ravindranath. Experienced in CakePHP for the past 10 months.
> Able to create highly professional, high quality website on Cakephp.
> You can contact me thro,
> 1. email - ravindranat...@gmail.com
> 2. mobile - 9380567762
>
> Regards,
>
> Ravindranath.
>
> On Nov 5, 11:04 am, Selva  wrote:
> > Hello Guys,
> >
> > I apologize in advance if this is not the appropriate forum to ask
> > this question, but I am interested in finding a Cake Developer to work
> > on a new project.
> >
> > Thanks,
> > Selva
>
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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 helper -> inputs -> textarea -> cols?

2008-12-24 Thread sijo jose
Hey why cant u try the $form->input option.

Its quiet easy.

input('SamplingDetail.sampling_address',
array('error'=>'Sampling Address cannot be left empty','div' =>
'mandatory','type'=>'textarea','label' => 'Sampling Address', 'rows' => 3,
'cols' => 35)); ?>

Regards
Sijo

On Fri, Dec 12, 2008 at 7:31 PM, leberle  wrote:

>
> hi all :) one simple (i guess) question: i'm using the inputs method
> for creating several input-elements in my view. i want one field to be
> a textarea, i used
>
> $html->inputs(
>[...bunchofotherinputs],
>'mytextfield' => array('type' => 'textarea', 'cols' => 2),
>[...]);
>
> The generated input gets the textarea-option but fails to get the
> number of cols i definied...so i got a textarea thats way to largs.
> Someone can help me with that?
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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: Error Messages Not Displaying in View or in Validations Array

2008-12-24 Thread sijo jose
hi,

As earlier said u are sending the form data to a
different page...

function thank_you()
  {

> if( !empty($this->data) )
>   {
>  $this->User->create();
>  if( $this->User->save($this->data) )
>  {
>  }
> else
> {
>  $this->redirect(array('action' => 'index'),null,true);
> }
>   }
>   else
>   {
>  // we're at this place because a form was not filled in
>  $this->redirect(array('action' => 'index'),null,true);
>   }
>  }


Now in cakePHP the validation works when u call save.
so if  if( $this->User->save($this->data) ) is false it means that ur form
has errors

So what u r doing is that u are redirecting the page when there are form
erros.
So give any redirect page in the else condition it will automatically come
to ur form page.

Also there is no need for $this->User->create();

Think u got the point.

Regards
Sijo Jose C







On Fri, Dec 19, 2008 at 7:24 PM, Smelly_Eddie  wrote:

> Just a guess but it looks like your sending the form data to a
> different page...
>
> Validation was intended to display on the same model in a circular
> manner. i.e. empty user/add form is shown -> data submitted to user/
> add action -> user/add validates data -> form is repeated if invalid
> OR redirect user to secondary page.
>
>
>
>
> On Dec 18, 3:51 pm, Tony  wrote:
> > For some reason I can't get my error messages for validations to work.
> > I tried outputting the validations by doing:
> > pr($this->validationErrors);
> >
> > But all I get is an empty array. What do you guys see that I'm doing
> > wrong?
> >
> > Thanks,
> > Tony
> >
> > Here's my model:
> > 
> > class User extends AppModel {
> >
> > var $name = 'User';
> >
> > // This model is a self-join
> > var $belongsTo  =   array(
> >
> 'ParentMember' => array(
> >
>   'className' => 'User',
> >
>   'foreignKey' => 'parent_id'),
> > );
> >
> > var $hasMany=   array(
> >
> 'ChildMember' => array(
> >
>   'className' => 'User',
> >
>   'foreignKey' => 'parent_id'),
> > );
> >
> >// Place the validation rules here:
> >
> >var  $validate = array(
> > 'first_name' => array(
> > 'rule' => 'alphaNumeric',
> > 'required' => true,
> > 'message' => 'Name is required. Please
> enter your first name.',
> > 'last' => true
> > ),
> > 'email' => array(
> > 'rule' => array('email', true),
> > 'required' => true,
> > 'message' => 'Email is required. Please
> enter your email
> > address.',
> > 'last' => true
> > ),
> > 'phone' => array(
> > 'rule' => array('phone', null, 'us'),
> > 'message' => 'Phone number is not valid.
> Please enter valid phone
> > number.',
> > 'last' => true
> > )
> >);
> >
> > }
> >
> > 
> >
> > Here's my controller with the method action it's being submitted to:
> > 
> > function thank_you()
> > {
> > $member = $this->Session->read('teamMember');
> > $this->set('pageTitle', 'Before you leave TriVita
> Cooperative
> > Marketing\'s website');
> > $this->set('bigTitle', 'BEFORE YOU LEAVEA SPECIAL THANK
> > YOU FROM ME...');
> > $this->set('member', $member);
> >

Re: How to validate 2 linked models created from one form?

2008-12-24 Thread sijo jose
Hi,

Since u have created the form for the model Order,

The field title should be referred like

$form->input("Customer.title"); directly.

Now when u r saving use saveAll

$this->Order->saveAll($this->data,array('validate' => 'first'));

All the validation rules can be in ur model itself.

The array('validate' => 'first') specifies that all the models must be
validated first before saving recursively.

Also u have to take into consideration that at present cakePHP supports
recursive saving  for first level only.

Think I was helpful.
Regards
Sijo

On Mon, Dec 22, 2008 at 2:42 PM, Hipnotik  wrote:

>
> Hello again ;)
> I have 2 models:
>
> Order:
> hasOne = "Customer"
>
> Customer:
> belongsTo = "Order"
> var $validate = array(lot of rules)
>
> I would like to create a form to provide data for Customer object then
> send form to OrdersController and validate.
>
> How to create proper form?
>
> I have this:
> $form->create("Order", array("action" => "send"));
> $form->input("Order.Customer.title");
> // more fileds
> $form->end("Send")
>
> It sends data to "send" action of OrdersController, but how to create
> Customer object, validate and display errors on the form if occur?
>
> Thanks for help
> >
>


-- 
Sijo Jose Chakramakkil

--~--~-~--~~~---~--~~
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: Saving a Model with belongsTo association

2008-11-23 Thread sijo jose
Hi,

Thanks dude, My naming conventions was all correct just that I forgot to use
saveAll()


Regards
Sijo
On Tue, Nov 18, 2008 at 10:16 PM, thatsgreat2345
<[EMAIL PROTECTED]>wrote:

>
> It is all about how you name your forms and it will return the proper
> structure that a simple save can handle. Check out this link
>
> http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo
>
> On Nov 18, 3:32 am, Cjo <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am new to cake php and have been playing around for some time. First
> > of all thanks for all the replies for earlier queries.
> >
> > Regarding this post. I have 2 Models Exporter which belong to User.
> > I am doing a page for creating a New Exporter. But for creating a
> > Exporter I would have to save the corresponding User. All I need is
> > that all the information regarding the Exporter and its corresponding
> > User be taken from the same form.
> >
> > Can anybody help me with this. I would like to have a example
> > regarding this. How would be the form be looking and it naming
> > conventions for User fields. Validation also required for the User
> > fields.
> >
> > Regards.
> >
>


-- 
Sijo Jose Chakramakkil

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



Re: CSS formatting not appearing

2008-11-22 Thread sijo jose
I agree with ROD. If it is CSS, firebug rocks.

On Sun, Nov 23, 2008 at 2:22 AM, Rob <[EMAIL PROTECTED]> wrote:

>
> First, I would suggest you get a copy of Firebug - it rocks when
> trying to debug CSS issues.
>
> What exactly do you mean 'none of my CSS formats were applied'?
>
> If you left off the punctuation when you modified the #content, that
> would break things, but if all you did was to change the first element
> in the padding from 0px to 10px, that would only fail if another CSS
> tag prevented the change from being applied.
>
> On Nov 21, 12:05 pm, CJL <[EMAIL PROTECTED]> wrote:
> > (sorry I hit send by accident)
> >
> > Below is my original style.css:
> >
> > #content {
> >   clear:both;
> > margin-left: auto;
> > margin-right: auto;
> >   padding: 0px 40px 10px 40px;
> >   background-color: #fff;
> >   color: #333;
> > text-align: left;
> > width: 100%;
> >
> > Then I just changed the padding to:
> >
> > padding: 20px 40px 10px 40px
> >
> > After that, none of my CSS formats were applied.  I went back to the
> > style.css file and changed the padding back to the original settings,
> > but still none of my CSS formats are appearing.  Any help would be
> > greatly appreciated.  Thanks!
> >
> > On Nov 21, 11:51 am, CJL <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> >
> > > First off, I'm new to CakePHP and web development in general, so I
> > > apologize in advance if my question is a stupid one or has been asked
> > > already.  I've read up to chapter 7 in the cookbook, and I'd say I
> > > understand it on a high level, but can figure out the details if I
> > > know where to look.  I've installed CakePHP 1.1 and I am using MAMP.
> >
> > > Problem: My CSS formatting is not appearing, but what's strange is
> > > that it worked at first, then I made a tiny change to a padding
> > > argument, and now all my formatting is gone.  Below is my app/views/
> > > layouts/default.thtml:
> >
> > > 
> > > 
> > > 
> > > My Page -- 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> >
> > > 
> > > 
> > > 
> > > image('logo.jpg')?>
> > > 
> > >     
> > >   renderElement('menu',
> array('key'=>'val'))?>
> > > 
> >
> > > 
> > > flash();?>
> > > 
> >
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> >
> > > 
> > > 
> >
> > > So initially, like I said, my CSS worked.  I wanted to mess around and
> > > change my #content in the CSS file.  Below is the original style.css:
> >
> >
> >
>


-- 
Sijo Jose Chakramakkil

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



Re: File List in a particular Directory

2008-11-05 Thread sijo jose
Thx dude

On Tue, Nov 4, 2008 at 8:23 PM, AD7six <[EMAIL PROTECTED]> wrote:

>
>
>
> On Nov 4, 2:30 pm, Cjo <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have to show all the files that I have uploaded through my
> > application.
> > Please help me with this.
> >
> > Regards
> > Cjo
>
> http://api.cakephp.org/class_folder.html#cae6a10175cdf45d5e303edbe6432dfc
> >
>


-- 
Sijo Jose Chakramakkil

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