Re: Find condition on joined table

2010-10-20 Thread Nancy
The relationship has to be defined in both models. So make sure you
define Customers as belonging to Users and Orders belonging to
customers.
http://book.cakephp.org/view/1039/Associations-Linking-Models-Together#belongsTo-1042

On Oct 18, 8:02 am, Dan  wrote:
> Hi,
>
> I am trying out CakePHP on an existing (and messy) website to see if
> it is going to be beneficial to use it for the new features from now
> on. I have been creating a test model that allows admin to search
> through users based on various fields (userId, name, email address,
> orderId).
>
> I have 3 tables that are being used for this:
> Users
> Customers
> Orders
>
> Users links to Customers on a 1 to 1 relationship on 'userId',
> Customers links to Orders on a 1 to many relationship on 'customerId'.
>
> The search feature is working correctly, except that I can't figure
> out how to set conditions on the Orders table.
> This is the query I would write normally to get the user who placed a
> certain order:
>
> SELECT * FROM users u
> LEFT JOIN customers c ON u.userId = c.userId
> LEFT JOIN orders o ON o.customerId = c.customerId
> WHERE o.orderId = $orderId.
>
> I have set up models for Users, Customers and Orders, With 'Users
> $hasOne ' referencing Customers, and 'Customers $hasMany' referencing
> Orders.
>
> If the conditions only reference the Users table, the script brings
> out the Orders data correctly, but I can't get it to allow me to
> search for an orderId, as Orders is referenced by Users through
> Customers.
>
> Any help on this would be great, I can upload code if necessary.

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: Callback parentNode() not defined in Owner

2010-10-10 Thread Nancy
Well not exactly sure why this worked but putting a parentNode()
method in my Community model made the error go away. I just copied the
one from my user model. *shrug* I wish I understood what the heck I
was doing!

On Oct 10, 8:23 am, Nancy  wrote:
> I'm finally braving the waters of auth/acl. I'm going from the
> tutorial in the 1.3 cake docs.
> Here's how I defined it:
>
> modesl/user.php
> class User extends AppModel {
>    var $hasMany = array(
>        'Owner' => array(
>             'className' => 'Community',
>             'foreignKey' => 'owner_id',
>         ),
>    );
>
> models/community.php
> class Community extends AppModel {
>     var $belongsTo = array(
>         'Owner' => array(
>             'className' => 'User',
>             'foreignKey' => 'owner_id',
>         ),
>     );
>
> I made an additional association to the user model and called it
> owner_id and ever since I've been getting his error:
>
> Warning (512): Callback parentNode() not defined in Owner [CORE/cake/
> libs/model/behaviors/acl.php, line 64]
>
> 
> I have a parentNode function in my user model (mindlessly copied from
> the tutorial).
>
>     function parentNode()
>     {
>         if (!$this->id && empty($this->data))
>         {
>             return null;
>         }
>         if (isset($this->data['User']['group_id']))
>         {
>             $groupId = $this->data['User']['group_id'];
>         }
>         else
>         {
>             $groupId = $this->field('group_id');
>         }
>         if (! $groupId)
>         {
>             return null;
>         }
>         else
>         {
>             return array('Group' => array('id' => $groupId));
>         }
>     }
> ==
>
> Any suggestions on how to make that warning message go away?  I'm
> stumped.

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


Callback parentNode() not defined in Owner

2010-10-10 Thread Nancy
I'm finally braving the waters of auth/acl. I'm going from the
tutorial in the 1.3 cake docs.
Here's how I defined it:

modesl/user.php
class User extends AppModel {
   var $hasMany = array(
   'Owner' => array(
'className' => 'Community',
'foreignKey' => 'owner_id',
),
   );

models/community.php
class Community extends AppModel {
var $belongsTo = array(
'Owner' => array(
'className' => 'User',
'foreignKey' => 'owner_id',
),
);


I made an additional association to the user model and called it
owner_id and ever since I've been getting his error:

Warning (512): Callback parentNode() not defined in Owner [CORE/cake/
libs/model/behaviors/acl.php, line 64]


I have a parentNode function in my user model (mindlessly copied from
the tutorial).

function parentNode()
{
if (!$this->id && empty($this->data))
{
return null;
}
if (isset($this->data['User']['group_id']))
{
$groupId = $this->data['User']['group_id'];
}
else
{
$groupId = $this->field('group_id');
}
if (! $groupId)
{
return null;
}
else
{
return array('Group' => array('id' => $groupId));
}
}
==

Any suggestions on how to make that warning message go away?  I'm
stumped.

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: tinyint isn't generating a checkbox with form helper

2010-01-21 Thread Nancy
Oh!  I think I figured it out.  It needs to be tinyint(1), I was using
whatever the default was.  Doh!

On Jan 21, 3:34 pm, Nancy  wrote:
> I must be doing something wrong.  I have a database field that's a
> tinyint and accord to the online doc if I create a form field from it
> it should be a checkbox.  However, it creates a text field.
>
> My cakephp code looks like this in the view:
>
> echo $form->input('HasManymodel.{$count}.current");
>
> $count is just a variable being incremented as I step through the data
> in this relationship.  The data shows up on correctly but it just
> isn't figuring out the right form element to use, unless I specify
> everything.
>
> Any advice is truly appreciated!
>
> Nancy

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


tinyint isn't generating a checkbox with form helper

2010-01-21 Thread Nancy
I must be doing something wrong.  I have a database field that's a
tinyint and accord to the online doc if I create a form field from it
it should be a checkbox.  However, it creates a text field.

My cakephp code looks like this in the view:

echo $form->input('HasManymodel.{$count}.current");

$count is just a variable being incremented as I step through the data
in this relationship.  The data shows up on correctly but it just
isn't figuring out the right form element to use, unless I specify
everything.

Any advice is truly appreciated!

Nancy

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: Capture views output into a file?

2010-01-13 Thread Nancy
Thanks for the suggestions!
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


Capture views output into a file?

2010-01-04 Thread Nancy
I'd like to be able to automatically generate a file from the output
of a view.  Can anyone point me in the right direction?  I don't see
any file i/o available to views, maybe I'm just missing it.

Thanks!

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: Mysteriously inserted

2009-12-05 Thread Nancy
Ok, I found out something.  It was the line where I was putting out
"Stuff".  When I commented out that line  things were
better.  I had just forgotten that was supposed to be a fieldset
"Stuff".

Then I discovered having a /div inside a fieldset ends the fieldset,
so that was weird too.  Something was inserting the  before
my code actually inserts it.

Is it Firefox doing this?  I turned off all my addons just to see, no
change.

A mystery, wrapped in bacon!

On Dec 5, 2:25 pm, Nancy  wrote:
> This formatting happens in a helper and I return the $out variable and
> echo it.
>
>         foreach ($this->data['Resumeitem'] as $ri)
>         {
>
> #            debug(Sanitize::html($res->formatSection($ri, $count)));
>             echo $res->formatSection($ri,$count);
>             echo "\n\n";
>             $count++;
>         }
>
> The bottom of the $res->formatSection is just:
>
>         return $out;
>
> That debug() statement shows me the raw html and it looks absolutely
> right as it comes from the helper.  But when it gets output it's all
> weird.
>
> I did a bit of testing and it seemed like this weirdness with div's
> wasn't happening in the view so maybe I'll just move this function to
> the main view code, rather than the helper.  But I sure wish I
> understood what was happening.  I commented out everything in my
> app_controller just to make sure there wasn't something in there
> messing up, moved my css file out of the way.  Those were the most
> obvious places where I could imagine weird things like this happening,
> but that didn't change anything.

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: Mysteriously inserted

2009-12-05 Thread Nancy
Ok, I found out something.  It was the line where I was putting out
"Stuff".  When I commented out that line  things were
better.  I had just forgotten that was supposed to be a fieldset
"Stuff".

Then I discovered having a /div inside a fieldset ends the fieldset,
so that was weird too.  Something was inserting the  before
my code actually inserts it.

Is it Firefox doing this?  I turned off all my addons just to see, no
change.

A mystery, wrapped in bacon!

On Dec 5, 2:25 pm, Nancy  wrote:
> This formatting happens in a helper and I return the $out variable and
> echo it.
>
>         foreach ($this->data['Resumeitem'] as $ri)
>         {
>
> #            debug(Sanitize::html($res->formatSection($ri, $count)));
>             echo $res->formatSection($ri,$count);
>             echo "\n\n";
>             $count++;
>         }
>
> The bottom of the $res->formatSection is just:
>
>         return $out;
>
> That debug() statement shows me the raw html and it looks absolutely
> right as it comes from the helper.  But when it gets output it's all
> weird.
>
> I did a bit of testing and it seemed like this weirdness with div's
> wasn't happening in the view so maybe I'll just move this function to
> the main view code, rather than the helper.  But I sure wish I
> understood what was happening.  I commented out everything in my
> app_controller just to make sure there wasn't something in there
> messing up, moved my css file out of the way.  Those were the most
> obvious places where I could imagine weird things like this happening,
> but that didn't change anything.

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: Mysteriously inserted

2009-12-05 Thread Nancy
This formatting happens in a helper and I return the $out variable and
echo it.

foreach ($this->data['Resumeitem'] as $ri)
{

#debug(Sanitize::html($res->formatSection($ri, $count)));
echo $res->formatSection($ri,$count);
echo "\n\n";
$count++;
}

The bottom of the $res->formatSection is just:

return $out;

That debug() statement shows me the raw html and it looks absolutely
right as it comes from the helper.  But when it gets output it's all
weird.

I did a bit of testing and it seemed like this weirdness with div's
wasn't happening in the view so maybe I'll just move this function to
the main view code, rather than the helper.  But I sure wish I
understood what was happening.  I commented out everything in my
app_controller just to make sure there wasn't something in there
messing up, moved my css file out of the way.  Those were the most
obvious places where I could imagine weird things like this happening,
but that didn't change anything.

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


Mysteriously inserted

2009-12-04 Thread Nancy
This has me going nuts.  I'm using 1.2.5 and I'm calling a helper that
formats some html and returns it to the view.  Anyway, in this helper
I have some divs.  Something in cake is inserting "" in my code
because I'm not doing it.

Any ideas?

Oh yes, I've used Santizie::html to dump out the HTML that's
generated.  It looks fine.  But when I look at the output in my
browser (view source) there's all kinds of stuff inserted I didn't put
in there.

The function (views/helpers/res.php)
function formatSection($ri, $count)
{
App::import('Sanitize');
$out = '';
$out .= "after div";
$out .= 'this is crazy! ';
$out .= "{$ri['heading']}";
$out .= "{$ri['yearsexp']} Years experience\n";
$out .= "{$ri['description']}\n";
$out .= "";
$out .= "Edit
section\n";
#$out .= "\n".$this->Misc->div("editSection{$count}",'hide');
$out .= "\n".$this->Form->input("Resumeitem.{$count}.id", array
(
'type'=>'hidden',
'value'=>$ri['id'],
)
);
$out .= $this->Misc->br(1);
$out .= "\n".$this->Form->input("Resumeitem.{$count}.heading",
array(   'label'=>'Section
Heading',
'maxLength'=>100,
'size'=>100,
'value'=>$ri['heading'],
)
);
...

Here's what I end up seeing in my "view source" from the browser:

after divthis is crazy! 
Data and Application Management3 Years
experience
Experience with Storage Area Networks (SANS), large-scale,
multi-platform backups, assessing data availability and application
availability needs. Familiar with many tools and services available to
provide extremely low downtime for data and applications such as
network clusters and VMWare. 



As you can see, I don't have a closing on my "" until later on.
Yet something is inserting that in there immediately after I open the
.

Anyone have any ideas what might be happening?

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: How to copy a deep database hierarchy?

2009-09-19 Thread Nancy

I have used saveAll but it doesn't seem to really handle very deep
associations well.  I'm afraid it might not work for this because
we're talking about 40+ tables all linked!

On Sep 18, 11:07 pm, Bert Van den Brande  wrote:
> I haven't done this before, but I think this can be accomplished by using
> the saveAll() function :http://book.cakephp.org/view/75/Saving-Your-Data.
> Have a look at the saveAll() documentation, and also at this section 
> :http://book.cakephp.org/view/75/Saving-Your-Data#Saving-Related-Model...
>
> My approach would be to
> * load the Recipe with it's Ingredients and Tags from database
> * manipulate the data by removing the 'id' information from the models
> * pass the manipulated data to the saveAll() method
>
> Friendly greetings,
> Bert
>
> On Fri, Sep 18, 2009 at 9:16 PM, Nancy  wrote:
>
> > Maybe this is more of a database question than a Cakephp question
> > but...
>
> > I have a database with about 40 tables all related and I'm going to
> > need to make copies of a whole deeply nested database structure, just
> > changing id's be coming the interconnections.  Does anyone know of a
> > reasonable way to do this?
>
> > I'm using MySQL.
>
> > Many thanks!
>
> > Nancy
>
> > Simple Example:
>
> > Recipe -> Ingredients
> >           -> Tags
>
> > Lets say I want to copy the Apple Pie recipe and all it's related
> > records to a new structure but none of the data are shared between the
> > two copies.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to copy a deep database hierarchy?

2009-09-18 Thread Nancy

Maybe this is more of a database question than a Cakephp question
but...

I have a database with about 40 tables all related and I'm going to
need to make copies of a whole deeply nested database structure, just
changing id's be coming the interconnections.  Does anyone know of a
reasonable way to do this?

I'm using MySQL.

Many thanks!

Nancy

Simple Example:

Recipe -> Ingredients
   -> Tags

Lets say I want to copy the Apple Pie recipe and all it's related
records to a new structure but none of the data are shared between the
two copies.
--~--~-~--~~~---~--~~
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 expiration with "medium" security level -- doesn't happen.

2009-09-14 Thread Nancy

I think I figured it out.  I used the example from the CakeBook but
one line was causing me grief:
ini_set('session.cookie_domain', env('HTTP_BASE'));

Maybe something about my home development setup but HTTP_BASE is 0.0.1
instead of 127.0.0.1.  So I hard coded it to 127.0.0.1 and it works ok
now.


On Sep 14, 2:38 pm, Nancy  wrote:
> I've had to switch from high because my ajax calls were mangling
> sessions info.  So I switched to medium.  Now it appears no matter
> what I do (tried a custom config and all) my session creates a cookie
> that expires in 1 week.  When was on high the cookie would expire with
> the session (i.e. the browser closes).  I've been tweaking timeout and
> it just doesn't seem to work at all.
>
> Does anyone know of a good example of getting this to work properly?
> I guess I can do my own expiration checking, but I'd rather the
> framework handled it correctly.
>
> Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Session expiration with "medium" security level -- doesn't happen.

2009-09-14 Thread Nancy

I've had to switch from high because my ajax calls were mangling
sessions info.  So I switched to medium.  Now it appears no matter
what I do (tried a custom config and all) my session creates a cookie
that expires in 1 week.  When was on high the cookie would expire with
the session (i.e. the browser closes).  I've been tweaking timeout and
it just doesn't seem to work at all.

Does anyone know of a good example of getting this to work properly?
I guess I can do my own expiration checking, but I'd rather the
framework handled it correctly.

Thanks!
--~--~-~--~~~---~--~~
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: store array into session

2009-08-31 Thread Nancy

Have you tried it?  It does store it as a string but seems to recreate
it as an array when you read it back in.  At least, I tried it
yesterday and it seemed to do the right thing.

On Aug 28, 1:31 am, persianshadow  wrote:
> hi
>
> i want store array of ids into session but i explore API of cakephp
> and see  $value ( Session->write($name,$value) )
>
> only get string , i need it for store id of items  that user select .
>
> anybody have idea for do this ?
>
> thanks
--~--~-~--~~~---~--~~
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: Where do you put code needed in controllers and models?

2009-08-28 Thread Nancy

I think the model was definitely the right, maybe the only place for
it, where I wouldn't have to repeat it.  Thanks!

On Aug 27, 12:28 pm, Melgior  wrote:
> Most people seem to be fan of 'fat' models: put all your code that
> handles data in your models and keep your controllers thin and easy to
> read. Since your function parses data I would put it into the model
> indeed. If you need it in every model/controller, you can add it to
> app_model. You could also create a behaviour (the model's equivalent
> of a component).
>
> On 27 aug, 20:57,Nancy wrote:
>
> > Would a component be the right thing to use?  For instance, I have a
> > routine that parses data and I need it both in models and
> > controllers.  How do you include a component in model?
>
> > I guess I can always access the model from the controller, so perhaps
> > app_model is a better choice.
>
> > Any opinions welcome!
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-27 Thread Nancy

Ok, just caught something in the cakephp online docs:
saveAll(array $data = null, array $options = array())

Used to save (a) multiple individual records for a single model or (b)
this record, as well as all associated records

So perhaps this means I'm just trying to do something that isn't
supported.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Where do you put code needed in controllers and models?

2009-08-27 Thread Nancy

Would a component be the right thing to use?  For instance, I have a
routine that parses data and I need it both in models and
controllers.  How do you include a component in model?

I guess I can always access the model from the controller, so perhaps
app_model is a better choice.

Any opinions welcome!
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-27 Thread Nancy

I guess the looping method isn't a bad solution, I just kept thinking
that I must be doing something wrong.  The documentation on saveAll is
pretty sketchy on details.
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-27 Thread Nancy

I think maybe the difference between what you and I was doing is that
I was trying to save multiple "main" records at one time, whereas you
were doing one.

$this->data[1]['Recipe']['name'] = 'Delicious apple pie';
$this->data[1]['Recipe']['serves'] = 6;
$this->data[1]['Recipe']['valid'] = 1;
$this->data[1]['Tag'][0]['tag_id']=4;
$this->data[1]['Tag'][1]['tag_id']=2;
$this->data[1]['Tag'][2]['tag_id']=3;
$this->data[1]['Recipe']['name'] = 'Pork spare ribs';
$this->data[1]['Recipe']['id'] = 166;
$this->data[1]['Recipe']['serves'] = 4;
$this->data[1]['Recipe']['valid'] = 1;
$this->data[1]['Tag'][0]['tag_id']=1;
$this->data[1]['Tag'][1]['tag_id']=5;
$this->data[1]['Tag'][2]['tag_id']=9;


-

Once I added the hasMany ingredients that broke and I had to loop
through
the data and save each one individually:

foreach ($this->data as $save)
{
$this->saveAll($save);
}

So $save would look like this:

$save['Recipe']['name'] = 'Delicious apple pie';
$save['Recipe']['serves'] = 6;
$save['Recipe']['valid'] = 1;
$save['Tag'][0]['tag_id']=4;
$save['Tag'][1]['tag_id']=2;
$save['Tag'][2]['tag_id']=3;
$save['Ingredient'][0]['name']='sugar';
$save['Ingredient'][1]['name']='apples';

and so on...
--~--~-~--~~~---~--~~
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: Class and Model Naming Problems (wave becomes wafe)

2009-08-24 Thread Nancy

This isn't going to help but I bet maybe it uses the the same rules
for waves/wafe as it does for wives/wife. :D

On Aug 21, 12:10 pm, JDRopp  wrote:
> Thanks Marcelo for pointing to the relevant code.
>
> I decided to change the model, table, and controller names instead.
>
> I'll submit the defect to Cake.
>
> On Aug 21, 12:01 pm, Marcelo Andrade  wrote:
>
> > On Fri, Aug 21, 2009 at 3:21 PM, JDRopp wrote:
>
> > > I've just started working with Cake and have been impressed so far.
>
> > > I've created:
> > > A table called "waves"
> > > A model class called "wave" (wave.php)
> > > A controller class called "WavesController" (waves_controller.php)
>
> > > Somehow "wave" turns into "wafe" when SQL is generated.  For example:
> > > Nr      Query   Error   Affected        Num. rows       Took (ms)
> > > 1       DESCRIBE `waves`                3       3       38
> > > 2       SELECT COUNT(*) AS `count` FROM `waves` AS `Wafe` WHERE 
> > > `Wafe`.`id`
> > > = 1             1       1       0
> > > 3       SELECT `Wafe`.`id`, `Wafe`.`name`, `Wafe`.`deployment_date` FROM
> > > `waves` AS `Wafe` WHERE `Wafe`.`id` = 1 LIMIT 1         1       1       0
>
> > > Any idea what's going on here?  I've searched and found no "wafe"
> > > typos in my code.
>
> > Not sure, but It seems like a bug in inflector.
>
> > Try to add wave/waves to the $irregularPlurals at app/config/inflector.php
>
> > If it not works, I'm afraid you'll have to define the $useTable = 'waves'; 
> > in
> > your Wave model.
>
> > Best regards.
>
> > --
> > MARCELO DE F. ANDRADE
> > Belem, PA, Amazonia, Brazil
> > Linux User #221105
>
> >http://mfandrade.wordpress.com
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-22 Thread Nancy

Here's the structure I ended up having to go with
$save['Constoptvalue']['device_id'] = 16;
$save['Constoptvalue']['constopt_id'] = 1;
$save['Constoptvalue']['valid'] = 1;
$save['Compoundchainlist']['name'] = 'poohbear';
$save['Layer'][0]['layer_id']=4;
$save['Layer'][1]['layer_id']=2;
$save['Layer'][2]['layer_id']=3;

So I can only save one 'Constoptvalue' with it's related data at once,
rather than everything that was modified (multiple rows).  *sad face*

On Aug 21, 2:22 am, Luke  wrote:
> Hi Nancy,
>
> I had the same issue like you are describing, how to save the
> hasMany after positing it on here, I found the solution.
>
> I have a recipe hasMany Ingredient relationship, the importance is to
> have the array formated in the right way. It needs to look like below,
> than it will work.
>
>  [Recipe] => Array
>         (
>             [recipe_name] => Champions
>             [Rezeptportion] => 2
>         )
>
> [Ingredient] => Array
>         (
>             [0] => Array
>                 (
>                     [ingredientname] => Champions
>                 )
>
>             [1] => Array
>                 (
>                     [ingredientname] => pepper
>                 )
>
> Try this out and let me know if you struggle, maybe we find an answer.
>
> Luke
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-22 Thread Nancy

Yeah, this is essentially what I had to end up doing.  I wanted to
save a bunch of records at once and it worked great until I added the
hasOne/hasMany relationship.   So I had to stop saving them all at
once and do one at a time.  But at least it saves the associated data
at the same time as it does the main data.

I wish that I could figure out a way to save ALL the data at once,
rather than one row (and associated rows) at a time.  It just seems
like the way I ended up doing it is rather cheesy.

On Aug 21, 2:22 am, Luke  wrote:
> Hi Nancy,
>
> I had the same issue like you are describing, how to save the
> hasMany after positing it on here, I found the solution.
>
> I have a recipe hasMany Ingredient relationship, the importance is to
> have the array formated in the right way. It needs to look like below,
> than it will work.
>
>  [Recipe] => Array
>         (
>             [recipe_name] => Champions
>             [Rezeptportion] => 2
>         )
>
> [Ingredient] => Array
>         (
>             [0] => Array
>                 (
>                     [ingredientname] => Champions
>                 )
>
>             [1] => Array
>                 (
>                     [ingredientname] => pepper
>                 )
>
> Try this out and let me know if you struggle, maybe we find an answer.
>
> Luke
--~--~-~--~~~---~--~~
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: saveAll with a hasMany relationship

2009-08-19 Thread Nancy

I just wanted to add, I'm saving multiple records at a time.  So $this-
>data might have an index going up to 5 or so with models for 3 or
more different things.

I did manage to get a hasMany to work, but not with multiple records.

$save['Firstname']['firstname']='Margarie';
$save['Nickname'][0]['nickname'] = 'Margy';
$this->Firstname->saveAll($save);

That worked, but what if I want to save 3 different firstname/nickname
pairs at a time?


--~--~-~--~~~---~--~~
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 with a hasMany relationship

2009-08-19 Thread Nancy

I was so happy.  I finally figured out how to make saveAll work with
my HABTM relationship so I figured adding a hasMany would be a piece
of cake.  I have a little practice data structure set up to test it
out.

$save[1]['Constoptvalue']['device_id'] = 16;
$save[1]['Constoptvalue']['constopt_id'] = 1;
$save[1]['Constoptvalue']['valid'] = 1;
$save[1]['Layer'][0]['layer_id']=4;
$save[1]['Layer'][1]['layer_id']=2;
$save[1]['Layer'][2]['layer_id']=3;

This works brilliantly.  So then I add in my hasMany data:
$save[1]['Cotest'][0]['symbol']='buggers';

And do my saveall:
$this->Constoptvalue->saveAll($save);

Everything works, except Cotest.  I can tell the relationship is
defined well, I get the proper data when I read my Constoptvalue
structure.

Any ideas?  Darn, I thought I had this nailed finally.

Thanks all.


--~--~-~--~~~---~--~~
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: Is it an insert or an update?

2009-08-14 Thread Nancy

I'll give it another try.  I did try this but had it not save some
data.  Maybe there was something else causing foofiness.  Thanks for
the help!

On Aug 13, 6:58 pm, Jamie  wrote:
> Basically, if the data you're saving has an id (or whatever the
> primary key of the model is), then the code will execute an update
> statement. Otherwise, it'll insert. You don't need to check
> beforehand, in other words, since the Cake code will determine from
> the data passed whether it should update or insert.
>
> Nancy wrote:
> > MySQL lets you use replace syntax if you have data and you don't know
> > if it's new or not.  Is there anything in Cakephp that'll let you do
> > that?   In other words, I don't know if the data I'm putting into my
> > database is brand spanking new or just updated.  I'd rather not have
> > to check and just let the database handle it, but not sure the
> > framework supports that.
>
> > Anyone know?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Is it an insert or an update?

2009-08-13 Thread Nancy

MySQL lets you use replace syntax if you have data and you don't know
if it's new or not.  Is there anything in Cakephp that'll let you do
that?   In other words, I don't know if the data I'm putting into my
database is brand spanking new or just updated.  I'd rather not have
to check and just let the database handle it, but not sure the
framework supports that.

Anyone know?
--~--~-~--~~~---~--~~
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: Strange association behavior

2009-07-21 Thread Nancy

Sorry, more info to add:

It works fine if I do the query through the Layerrule model, but not
through the Ruleitem model.
--~--~-~--~~~---~--~~
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: Strange association behavior

2009-07-21 Thread Nancy

I just wanted to add, I don't get any error from the query like I
would if I added an unrelated model to the 'contain' array.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Strange association behavior

2009-07-21 Thread Nancy

I must be missing something... maybe fresh eyes can see the problem.
Hopefully!  I have a complex set of table associations that looks like
this:

layers
  id

ruleexceptions
  id

rulevaluetypes
  id

layerrules
  id
  layer1_id
  layer2_id
  ruleexception_id

ruleitems
  id
  layerrule_id
  exception_id

ruleitemvalues
  id
  ruleitem_id
  rulevaluetype_id

Everything works great, except I can't get layerrules and ruleitems to
link up.  The model for layerrules says:

models/layerrule.php:var $hasMany = array('Ruleitem');
models/ruleitem.php: var $belongsTo = array
('Kit','Ruleexception','Layerrule');

Trying to read using any of these models works great except Ruleitem
doesn't link up to Layerrule.  No errors or anything.  Here's one of
my sample queries from Ruleitemvalue model:

function getByRIV($list)
{
$find = array_keys
($list);
$get = $this->find('all', array(
'contain' => array(
'Ruleitem' => array(
'Layerrule',
'Ruleexception',
),
),
'conditions' => array("Ruleitemvalue.id" => $find),
)
);
return $get;
}

Snippet from the data returned:
Array
(
[0] => Array
(
[Ruleitemvalue] => Array
(
[id] => 26
[rulevaluetype_id] => 1
[ruleitem_id] => 14
[kit_id] => 1
[value] => 2
[rule] => def
[valid] =>
)

[Ruleitem] => Array
(
[id] => 14
[layerrule_id] => 24
[ruleexception_id] => 5
[kit_id] => 1
[Ruleexception] => Array
(
[id] => 5
[name] => ntie
[desc] =>
[kit_id] => 1
[nonexception] => 0
)

)

)

--~--~-~--~~~---~--~~
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: Beginning CakePHP from Novice to Professional book problem: has anyone read this book?

2009-07-12 Thread Nancy

I bought the book 8 months ago or so and it was already out of date.
There weren't all that many errata but the code didn't work with
current versions.  However, the author has a web site and he was doing
a good job of helping folks out with the example code using newer
releases of Cakephp.

http://www.davidgolding.net/cakephp/ajax-file-uploading-with-cake-and-jquery.html

His forum: http://www.davidgolding.net/forum

On Jul 12, 3:00 am, armen  wrote:
> Forgot to ask.
> when looking at the source page, the add submit forum has the
> following option:
> onsubmit="event.returnValue = false;
> would this have to do with anything?
>
> this is the full line:
>  name="_method" value="POST" />

Re: Problem Storing Sessions from Login

2009-07-12 Thread Nancy

You'll want to use some of the session methods: 
http://book.cakephp.org/view/567/Methods

For instance:

$userId = $this->Session->read('user.id');  # OR something like that.

Or to check to see if it's set:

if (! $this->Session->check('user_id'))
$this->logon();

Hope that helps.

On Jul 11, 7:35 pm, damanlovett  wrote:
> I am SO new to Cakephp, although I love it I am having problems with
> my first app. I have been reading every possible article, book, and
> blog about sessions, but I can't get it right.
>
> I am trying to store the user's id and name in a session variable
> during the login process. Is there a simple way writing the the id and
> name in a session so I can use it throughout the site.
--~--~-~--~~~---~--~~
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: HATBM returning extra fields

2009-07-12 Thread Nancy

I think that's fine it is using a little too recursive for what you
want.  You can set recursive to -1 to only get the User table.   It's
an option you can put in your query or you can set it like this:
$this->Model->recursive = -1

There's also a 'behavior' called "Containable" that lets you determine
which tables you want because sometimes you just don't want the
default behavior.

Here's an example of a containable query from my project:

function getCalcParamsByDgid($id, $deviceId)
{
$this->Behaviors->attach('Containable');
$got = $this->find('first', array(
'contain' => array(
'Calcparam' => array(
'Calcparamvalue' => array(
'Unit',
'conditions' => array(
'Calcparamvalue.device_id' =>
$deviceId)
),
'Unit',
),
),
'conditions' => array(
'id' => $id,
),
));
return ($got);
}


On Jul 12, 4:30 am, Claudiu Apetrei  wrote:
> Hello,
>
> I am trying to get the hasAndBelongsToMany assosciations to work but I
> just can't get it to return the data right. It always returns the
> joinTable fields for each relation.
>
> I have a table BreedConnections and want to get the associated users,
> I get the user array right but also get in that array the jointable
> fields. Everything works ok but it's not really good since it doubles
> the amount.
>
> This is how it looks for each user :
>
>  [User] => Array
>                 (
>                     [0] => Array
>                         (
>                             [id] => 1
>                             [avatar] => claudiu_apetrei_1
>                             [avatar_type] => .jpg
>                             [nume] => Apetrei
>                             [prenume] => Claudiu
>                             [BreedConnection] => Array
>                                 (
>                                     [id] => 11
>                                     [rasa_id] => 11
>                                     [rasa_nume] => Ciobanesc german
>                                     [rasa_url] => ciobanesc-german
>                                     [type] => 1
>                                     [target_id] => 1
>                                     [data] => -00-00 00:00:00
>                                     [auto_remove] => 1
>                                 )
>
>                         )
>
>                 )
>
> Is this how it's supposed to return or am I doing something wrong ?
>
> Thank You,
> Claudiu
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ajax question -- Updating multiple divs

2009-06-19 Thread Nancy

Ok, I've got one select list that needs to drive the contents of two
other select boxes.  I understand how to use observeField and
apparently I can update multiple divs.  My question is, do I have to
do it from only one controller action or can more than one controller
be used?  It's just weird because the data comes from two different
tables and you wouldn't ordinarily access from the same controller.

Here's my current Ajax calls:

echo $ajax->observeField('DeviceDgtypeId', array(
'url' => '/subtypelists/getSubtypelists',
'update' => 'DeviceSubtypelistId',
)
);
echo $ajax->observeField('DeviceDgtypeId', array(
'url' => '/cells/getCellsByDgid',
'update' => 'DeviceCellId',
)
);

So... in a perfect world I'd probably want to do this:
echo $ajax->observeField('DeviceDgtypeId', array(
'url' => array('/cells/getCellsByDgid', "/subtypelists/
getSubtypelists"),
'update' => array('DeviceCellId',"DeviceSubtypelistId"),
)
);

But that doesn't seem to work.  So I'm assuming it has to come from
one controller.

So if I have to return two sets of data from one controller, how do I
render it so that the observeField knows which data goes to which div?

I'm so confused!

Thanks :)
--~--~-~--~~~---~--~~
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: Javascript in Ajax views

2009-06-11 Thread Nancy

Ok, here's what I ended up doing and I think it works.

I have this getting loaded in my "main" page.

function sethtml(div,content)
{
var search = content;
var script;

while( script = search.match(/(]+javascript[^>]+>\s*
()?\s*<\/script>)/))) break;

  block = search.substr(0, search.indexOf(RegExp.$1));
  search = search.substring(block.length + RegExp.$1.length);

  var oScript = document.createElement('script');
  oScript.text = block;
  document.getElementsByTagName("head").item(0).appendChild
(oScript);
}

document.getElementById(div).innerHTML=content;
}

/* I'm not clever enough to write this, found it here:
http://www.modernmethod.com/sajax/forum/viewtopic.php?t=847 */

In my ajaxlink I have a callback on completion to sethtml like this:

$this->Ajax->link($text, $opts, array('update' =>
$update."Data",
'complete' => "sethtml('".$update."Data',request)",
)
);


Through trial and error I found that request contains the content
returned from the Ajax call.

It seems to work!
--~--~-~--~~~---~--~~
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: Javascript in Ajax views

2009-06-11 Thread Nancy

Ok, I understand that. Thanks for the explanation. So it almost sounds
like I need to either have the events external to the tags or else I
need some code to evaluate the javascript in the tags (I found a pure
javascript example).  But where would I put that code?  In my main
page or inside the Ajax rendered view?  Hmmm... maybe it doesn't
matter.

I think from my experiments I determined that code inside the 

Javascript in Ajax views

2009-06-10 Thread Nancy

Something seems to happen when you have javascript embedded in an ajax
rendered view and it is getting me confused!

I have this line at the top, it works when I call the view directly,
but doesn't seem to do anything when ajax renders the view:

link('clearSelect'); ?>

I see the alerts when the page is loaded directly but not through
ajax.   The function works ok when loaded directly but not through
ajax.  I'm using Protype and Ajax.

== clearSelect.js ==
alert("hello!");
function unselectAll(ele)
{
alert(ele);
var obj=$(ele);
for (var i=0; i < obj.options.length; i++)
{
obj.options[i].selected = null;
}
}
=

I've also run into this issue when I have buttons and things on my
form I try to put some Javascript on, and they just don't work.  I've
googled for an answer and realize that perhaps events aren't getting
hooked up but I'm not knowledgeable enough to figure out on my own how
to address that.  So any specifics would be hugely appreciated!  And
it looks like my javascript source file isn't being included at all.

--~--~-~--~~~---~--~~
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: Submit/Cancel problem

2009-05-19 Thread Nancy

Buttons without type of submit don't really do anything without
onClick javascript right?  I tried your idea and it just doesn't do
anything.  Reset just resets a form.  I'd use the Javascript but I'm
not entirely sure to how make that work with Ajax.

On May 18, 5:35 pm, "Gabriel A. Gonzalez" 
wrote:
> Use "reset" or "button" NOT "submit" type for the cancel button.
>
>  or  value="cancel" type="button">
>
> Nancyescribió:
>
> > So, I added a submit and a cancel button to my ajax form and it
> > doesn't matter which you press, it always returns the submit button,
> > not the cancel.
>
> > The view code has this at the bottom (I stopped using helpers to see
> > if raw HTML would help, it didn't):
> >     
> >     
>
> > In the controller (admin_edit) function, I'm dumping out the contents
> > of $this->params['form'] and it always shows
>
> > Array
> > (
> >     [Submit] => submit
> > )
>
> > Even if you press the cancel button.  Am I doing something wrong?
>
> > Thanks!
>
> >Nancy
--~--~-~--~~~---~--~~
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: Submit/Cancel problem

2009-05-19 Thread Nancy

Okie doke:


form('purposes','post',array(
'model'=>'Purpose',
'update'=>'purposesData',
'url'=>array(
'controller' => 'purposes',
'action' => 'add',
'admin' => 1,
)
));
echo $form->input('name');
echo $form->input('desc');
echo $form->input('layerrules',
array(
'label'=>'Allow in Layer rules?',
'checked'=>true
)
);
echo $form->input('kit_id',
array('type'=>'hidden',
'value'=>$kitid));
echo $this->renderElement('all/btmbuttons');
echo $form->end('purposes');
?>

/* End of views/purposes/add.ctp Code */

Then all/btmbuttons is where the submit/cancel buttons are.
/* Bottombtns currently: */


/* End of bottombtns rendered Element */


On May 18, 10:26 pm, John Andersen  wrote:
> Please show the code in which you create the buttons, together with
> the surrounding form code!
> Then we may be able to assist you :)
>    John
>
> On May 19, 2:11 am,Nancy wrote:
>
> > So, I added a submit and a cancel button to my ajax form and it
> > doesn't matter which you press, it always returns the submit button,
> > not the cancel.
>
> > The view code has this at the bottom (I stopped using helpers to see
> > if raw HTML would help, it didn't):
> >     
> >     
>
> > In the controller (admin_edit) function, I'm dumping out the contents
> > of $this->params['form'] and it always shows
>
> > Array
> > (
> >     [Submit] => submit
> > )
>
> > Even if you press the cancel button.  Am I doing something wrong?
>
> > Thanks!
>
> >Nancy
--~--~-~--~~~---~--~~
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: Submit/Cancel problem

2009-05-19 Thread Nancy

Yeah, that's exactly how I started out but every time it only returns
the submit.  Eventually I hard coded the html just to make sure.

On May 19, 1:55 pm, Brett Wilton  wrote:
> You can use something like this in your view (code snips):-
>
> 
>                          echo $form->submit('Save', array('div'=>false, 
> 'name'=>'submit'));
>                 echo $form->submit('Cancel', array('div'=>false, 
> 'name'=>'cancel'));
>         ?>
> 
> end(); ?>
>
> and in your controller :-
>
> if (array_key_exists('cancel', $this->params['form'])) {
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Submit/Cancel problem

2009-05-18 Thread Nancy

So, I added a submit and a cancel button to my ajax form and it
doesn't matter which you press, it always returns the submit button,
not the cancel.

The view code has this at the bottom (I stopped using helpers to see
if raw HTML would help, it didn't):



In the controller (admin_edit) function, I'm dumping out the contents
of $this->params['form'] and it always shows

Array
(
[Submit] => submit
)

Even if you press the cancel button.  Am I doing something wrong?

Thanks!

Nancy

--~--~-~--~~~---~--~~
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: How to extend ajax helper?

2009-05-15 Thread Nancy

Great thanks!

On May 14, 10:02 pm, Kyo  wrote:
> Use require_once() before the class statement and it'll do the trick.
>
> require_once LIBS . 'view'. DS . 'helpers' . DS . 'ajax.php';
> class MyAjaxHelper extends AjaxHelper {
>
> }
>
> hth
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to extend ajax helper?

2009-05-14 Thread Nancy

I found some code which extends the AjaxHelper I dropped it into the
app/views/helpers directory and called it myajax.php and it complains:

Fatal error: Class 'AjaxHelper' not found in C:\xampp\www\pdkhi\app
\views\helpers\myajax.php on line 2

Here's the header at the top:
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax related question

2009-05-14 Thread Nancy

Oh hmmm... maybe this answers my question... I'm going to have to
decipher all the code that got sanitized :p
http://cakebaker.42dh.com/2006/06/29/how-to-update-multiple-divs-with-ajax/

On May 14, 10:50 am, Nancy  wrote:
> This isn't necessarily a Cake question but maybe someone here can give
> me an idea of how to solve this.
>
> I have a display with a lot of individual index views being generated
> by ajax.  Each of these indexes has a ajax links to forms (related to
> that table) that'll update the DB and then show an updated index.
> However, the issue is that the other index views being displayed are
> going to be out-of-date with respect to the changed view.  Is it
> possible to trigger updates of those views somehow?
--~--~-~--~~~---~--~~
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: Ajax related question

2009-05-14 Thread Nancy

So this could update a different view?  Here's a simple example, lets
say you have two tables:  Fruits Fruitproperties.

In the view for Fruits I show the color of the fruit, which comes from
fruitproperties.  In fruitproperties I show all the properties.

First index view on the page is like this:
=
Fruit View
Fruit Color (From properties)
Banana yellow
Orange  green
===
Fruit Properties
ColorSize
yellow   medium
greensmall


So the way I have it, you can click Fruit name (in the fruit view) or
color (in the properties view) and it replaces the current view with
the form to edit that item.  So if you go to the Fruitproperties
section and click green and change that to orange and fix the other
properties, it'll display correctly in the fruitproperties view but
the fruit view really needs to get refreshed.  So what I need is some
sort of way to trigger an event that'll trigger a redisplay of the
Fruit display.


On May 14, 11:13 am, Misplacedme  wrote:
> I don't do a lot of ajax, so this may be an over-simplified method of
> updating the view.
>
> setTimeout ( expression, timeout );
>
> Add that to the end of the ajax function that updates the views.
> Timeout is the amount of time it waits in MS before it runs
> expression.
> Set expression to the ajax function, and it will update and loop from
> then on.
>
> On May 14, 12:50 pm, Nancy  wrote:
>
> > This isn't necessarily a Cake question but maybe someone here can give
> > me an idea of how to solve this.
>
> > I have a display with a lot of individual index views being generated
> > by ajax.  Each of these indexes has a ajax links to forms (related to
> > that table) that'll update the DB and then show an updated index.
> > However, the issue is that the other index views being displayed are
> > going to be out-of-date with respect to the changed view.  Is it
> > possible to trigger updates of those views somehow?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ajax related question

2009-05-14 Thread Nancy

This isn't necessarily a Cake question but maybe someone here can give
me an idea of how to solve this.

I have a display with a lot of individual index views being generated
by ajax.  Each of these indexes has a ajax links to forms (related to
that table) that'll update the DB and then show an updated index.
However, the issue is that the other index views being displayed are
going to be out-of-date with respect to the changed view.  Is it
possible to trigger updates of those views somehow?
--~--~-~--~~~---~--~~
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: Append something to the Flash message

2009-05-11 Thread Nancy

What I do is save my messages to an array then do an join and setFlash
to the results of that join.
array_push($messages,'The Rule Exception has been
saved');
$this->Session->setFlash(join('',$messages));



On May 11, 6:10 am, Roman Brunnemann  wrote:
> Hi,
>
> short question. I call different methods of a controller on one page
> request. Most of the functions should write something to the view. I use
> setFlash for this. But it only shows me the message from the last
> "setFlash" call. Is there a way to append something to the existing value?
>
> Thanks a lot.
> Roman
--~--~-~--~~~---~--~~
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: Same queries in different controllers

2009-05-07 Thread Nancy

This seems like a good time to say "Doh!". Thanks much. :)

On May 6, 6:59 pm, "Dr. Loboto"  wrote:
> app_model.php
>
> On May 7, 12:00 am, Nancy  wrote:
>
> > So, this was great but I'm wondering if I can go a bit further with
> > this.
>
> > All these tables have queries that are very similar, so similar that I
> > could use exactly the same code in most of them, like here's an
> > example:
> > [code]
> > function getByKit($type, $id)
> > {
> >         $rows = $this->find($type, array(
> >             'conditions' => array('kit_id' => $id),
> >             'order' => array($displayField),
> >             )
> > );
> >        return $rows;}
>
> > [/code]
>
> > So where would it make sense to put this without having to duplicate
> > it in every model?  Is there something like app_controller.php for
> > models?
>
> > Thanks!
--~--~-~--~~~---~--~~
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: Same queries in different controllers

2009-05-06 Thread Nancy

So, this was great but I'm wondering if I can go a bit further with
this.

All these tables have queries that are very similar, so similar that I
could use exactly the same code in most of them, like here's an
example:
[code]
function getByKit($type, $id)
{
$rows = $this->find($type, array(
'conditions' => array('kit_id' => $id),
'order' => array($displayField),
)
);
   return $rows;
}
[/code]

So where would it make sense to put this without having to duplicate
it in every model?  Is there something like app_controller.php for
models?

Thanks!
--~--~-~--~~~---~--~~
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: Same queries in different controllers

2009-05-06 Thread Nancy

Nifty!  I'll give this a shot!

On May 5, 6:57 pm, brian  wrote:
> You can create a method in each model and place the find details
> there. Then, from the controllers:
>
> $foo = $this->YourModel->yourMethod(...)
>
> "Fat models, thin controllers", as the saying goes.
>
> On Tue, May 5, 2009 at 7:42 PM, Nancy  wrote:
>
> > I have a bunch of tables that are highly inter-related and I have them
> > all being displayed, like an initial index view, from one controller.
> > They're getting updated and the index of each table is refreshed via
> > that table's controller (Ajax).   The bad part about this is that I
> > have to keep the queries updated in two places, my main overview
> > controller and then in each tables controller.  Is there a way to
> > share a query code between controllers?
>
> > Thanks!
>
> > Nancy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Same queries in different controllers

2009-05-05 Thread Nancy

I have a bunch of tables that are highly inter-related and I have them
all being displayed, like an initial index view, from one controller.
They're getting updated and the index of each table is refreshed via
that table's controller (Ajax).   The bad part about this is that I
have to keep the queries updated in two places, my main overview
controller and then in each tables controller.  Is there a way to
share a query code between controllers?

Thanks!

Nancy
--~--~-~--~~~---~--~~
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: How to define a relationship where you use the same table more than once?

2009-05-04 Thread Nancy

Thanks Miles.  I did figure it out.  I decided to use whatever
defaults "cake bake" came up with and tweaked the model slightly.
That helped me figure out how to reference the data in the controller
and views too, later on.  Boy, cake bake sure is useful!

Here's what I ended up with:
[code]var $belongsTo = array(
'Layer1' => array(
'className' => 'Layer',
'foreignKey' => 'layer1_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Layer2' => array(
'className' => 'Layer',
'foreignKey' => 'layer2_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
[/code]

On May 4, 4:52 pm, Miles J  wrote:
> It would be a belongsTo I believe, I do this all the time (example, a
> category has a parent category (parent_id).
>
> var $belongsTo = array(
>         'Layer1' => array(
>         'className' => 'Layer',
>         'foreignKey' => 'layer1_id'
>     ),
>     'Layer2' => array(
>         'className' => 'Layer',
>         'foreignKey' => 'layer2_id'
>     )
> );
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to define a relationship where you use the same table more than once?

2009-05-04 Thread Nancy

I am wondering the proper cake-ified way of doing this.  I have
"layers" and they're related to other layers and also a thing called a
"relationship".  So here's the layer table (simplified):

Layers
=
id
name

Relationships

id
name

Now I need to define how two layers relate to one another like this:

layer1 layer2 relationship

My gut instinct is to make a table that looks like this:

Layerrules

layer1_id
layer2_id
relationship_id

But I'm not sure what I'd put in my model for Layerrule for having
that relationship to two of the same thing.
--~--~-~--~~~---~--~~
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: Database question, How do I represent a zero in a zero to one relationship?

2009-02-08 Thread Nancy

I'm not exactly sure how to do this in Cake but it sounds like you
want a left join, so that if there's no match you'll get back the row
but nulls in the unmatched row.  With a normal join you'd get nothing
back.
--~--~-~--~~~---~--~~
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: How do I access a HABTM relationship from another model?

2009-01-18 Thread Nancy

Ok, I must've gotten ahold of some out-of-date docs.

On Jan 16, 10:01 am, teknoid  wrote:
> That's not a good idea, because since your models are related they are
> already loaded.
>
> Actually, using $uses is rearely a good idea.
>
> The only time you might consider it, is when you need an absolutely
> unrelated model...
> Even still... within your action you can load the model just when you
> need it...
>
> $MyModel = ClassRegistry::init('MyModel');
>
> or even:
>
> $someData = ClassRegistry::init('MyModel')->getMeData();
>
> On Jan 16, 12:55 pm,Nancy wrote:
>
> > Thanks for you help, it has gotten me closer.
>
> > Another thing I figured out is I needed to use the $uses array, which
> > I didn't have.
>
> > var $uses = array('User','Recipe','Mastercat');
--~--~-~--~~~---~--~~
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: Nicer way to make a link to show/hide elements?

2009-01-18 Thread Nancy

Hi Miles!

I did look at $ajax->link, fooled around with it for what seemed like
hours, and couldn't figure out how to have it just show/hide the div
without specifying a url or link to some controller function/view.

An example would be great if you've got the code in your fingertips.

On Jan 18, 3:41 pm, Miles J  wrote:
> You dont have to use $html->link. Just write the anchor element
> manually.
>
> $html->link is usually used for internal linkings and routing.
>
> BUT you may take a look at $ajax->link.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Nicer way to make a link to show/hide elements?

2009-01-18 Thread Nancy

I want to make a simple link to hide or show div's without loading any
new URLs.  I just couldn't wrap my brain around it and resorted back
to calling Prototype functions directly.
[code]
Search Results
[/code]

Is there a pretty way to do this in CakePHP?

Thanks!

Nancy M.
--~--~-~--~~~---~--~~
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: How do I access a HABTM relationship from another model?

2009-01-16 Thread Nancy

Thanks for you help, it has gotten me closer.

Another thing I figured out is I needed to use the $uses array, which
I didn't have.

var $uses = array('User','Recipe','Mastercat');
--~--~-~--~~~---~--~~
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: How do I access a HABTM relationship from another model?

2009-01-15 Thread Nancy

I'm getting closer!  I have this right now:

$mastercats = $this->User->find('all',
array('conditions'=>array('User.id' => $id),
'contain' => array(
'Mastercat' => array(
'fields'=>array('id','desc')
),
),
)
);

I can't quite figure out how to get just the Mastercat id and
description of the ones associated with the user, and all the ones not
associated, so I can have a properly populated (with selections)
select list.

Any suggestions?  Maybe a manual query would be easier, but I still
don't know how to pass that to the view so it'd create a proper select
list.
--~--~-~--~~~---~--~~
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: How do I access a HABTM relationship from another model?

2009-01-15 Thread Nancy

On Jan 15, 3:32 pm, Miles J  wrote:
> Set your recursive level to 2/3 and the User association will grab the
> categories along with it. Use containable to filter the results.

I'm new to cakephp so I'll try to echo back what I think you're
saying.

In my recipes controller then I'd do something like this?

$this->User->Category('list',array('options'=>array('User.id'=>
$user_id),'recursive'=>2))

I haven't used containable, I'll have to look that one up.

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



How do I access a HABTM relationship from another model?

2009-01-15 Thread Nancy

Hopefully I can explain this adequately.  I have 3 models

Recipe:  belongsTo User
Recipe: HaBTM Category

User: HaBTM Category (same categories as recipes)
User: hasMany Recipe

Category: HaBTM User
Category: HaBTM Recipe

(join tables categories_users and categories_recipes)


Everything works great, in the recipe model I can get the categories
that belong to that recipe, in the user model I can get the categories
that belong to that user.  I can make selection lists with all the
right stuff.

What I can't figure out is how to get the categories that belong to
the user (for instance) when I'm in the recipe model.  I have access
to the user_id (stuffed away in the session).

Any pointers would be greatly appreciated!
--~--~-~--~~~---~--~~
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: Select list created from hasOne/belongsTo

2009-01-07 Thread Nancy

Excellent!  In all the books/tutorials I read, I don't think a single
one mentioned that. :p

On Jan 7, 1:58 pm, "Dardo Sordi Bogado"  wrote:
> http://book.cakephp.org/view/438/displayField
>
> On Wed, Jan 7, 2009 at 7:55 PM, Nancy  wrote:
>
> > Probably a simple question but I haven't been able to find the answer.
>
> > I have the table Recipes and another Difficulties
>
> > In recipe model:
> > var $belongsTo = array('Difficulty');
>
> > In difficulty model:
> > var $hasMany = array('Recipe');
>
> > The scaffolding always display the id number, not the text field
> > (desc) I want, unless I name the text field "name" in Difficulties
> > table.  I don't really want to do this.  How do I tell cakePHP to use
> > a different field name from it's assumed default of name?
>
> > Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Select list created from hasOne/belongsTo

2009-01-07 Thread Nancy

Probably a simple question but I haven't been able to find the answer.

I have the table Recipes and another Difficulties

In recipe model:
var $belongsTo = array('Difficulty');

In difficulty model:
var $hasMany = array('Recipe');

The scaffolding always display the id number, not the text field
(desc) I want, unless I name the text field "name" in Difficulties
table.  I don't really want to do this.  How do I tell cakePHP to use
a different field name from it's assumed default of name?

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



API Documentation Question

2008-12-11 Thread Nancy

So, I've been trying to use the API documentation found here:
http://api.cakephp.org/classes.html

But I can't figure out how to find the parameters and options that one
can send to the methods.   Is there better documentation of the API
elsewhere or am I just not using it correctly?

Thanks!

Nancy

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