Re: form->create() ::: how can use onSubmit in form->create()

2007-12-14 Thread WordPress Guru

Thanks Chris, and grigri

I understand the differnce between a manual and I think the purpose of
any good document is to at least inform the reader about the
parameters of any method. The api is so poorly documented that in most
case it does not tell in any detail about the parameters. For example
in one case, it tells that options array is just like form_remote_tag

http://api.cakephp.org/1.2/class_ajax_helper.html#eb375b9b0a13e633e2117a31b21129f6

The only option for me was to go through the code and if I could find
what individual associative component does the function expect in the
code. This is not very smart on the part of the documentation. They
probably used some tool to grab the comments based document and spit
it there.

Its better then nothing, but I was not expecting this as cakephp
itself is wonderful tool, so the document should at least match the
standards.

Maybe a user editable wiki will do the job, or something like php.net
which has user contributions as part of the manual.

My 2 cents




On Dec 14, 11:51 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 14, 2007 10:35 AM, WordPress Guru <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks and it works.
>
> > Just one more thing. I am totally frustrated with the documentation
> > available at api.cakephp.org . Do you guys have some other resource to
> > look to ?
>
> Well, api.cakephp.org is, well, documentation on the API.  Not a
> manual itself.  Check out the in-progress documentation for 1.2 
> athttp://tempdocs.cakephp.org.  Also check outhttp://bakery.cakephp.org.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: form->create() ::: how can use onSubmit in form->create()

2007-12-14 Thread WordPress Guru

Thanks and it works.

Just one more thing. I am totally frustrated with the documentation
available at api.cakephp.org . Do you guys have some other resource to
look to ?



On Dec 14, 10:41 am, grigri <[EMAIL PROTECTED]> wrote:
> $form->create('Model', array('url' => '...', 'default' => false));
>
> generates your form tag with onSubmit="event.returnValue = false;
> return false;", which is what you need
>
> On Dec 14, 2:15 pm, WordPress Guru <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello ,
>
> > I have a form that I am creating with form->create() , but I dont want
> > the form to be submitted as their is an ajax button in the form that
> > will [hopefully] submit the form. So I want to use onSubmit="return
> > false;" to stop the form from submitting.
>
> > I have tried the following,  that does not work.
>
> > echo $form->create('Model' , array('url'=>'/controller/action/'.
> > $id.'/' , 'onSubmit'=>'return false;') );
>
> > This was on the assumption that cake might be watching onSubmit inside
> > create method. Ahh that api. document is not worth much :(
>
> > Thanks in advance- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



form->create() ::: how can use onSubmit in form->create()

2007-12-14 Thread WordPress Guru

Hello ,

I have a form that I am creating with form->create() , but I dont want
the form to be submitted as their is an ajax button in the form that
will [hopefully] submit the form. So I want to use onSubmit="return
false;" to stop the form from submitting.

I have tried the following,  that does not work.

echo $form->create('Model' , array('url'=>'/controller/action/'.
$id.'/' , 'onSubmit'=>'return false;') );

This was on the assumption that cake might be watching onSubmit inside
create method. Ahh that api. document is not worth much :(

Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



baking batch or short cuts

2007-12-01 Thread WordPress Guru

Hello ,

Is someone of you automated the commonly usage options in bake.php ,
or if there is a way to force bake.php to use a defined config always.
I want to avoid giving the same answers again and again .

Regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to hand fileds in Model->read ...

2007-11-27 Thread WordPress Guru

Thanks Chris

I did not know to set Debug to 0 for production. Thats is great. Is
there any other checklist to do stuff before you go in production ?

Also I think I found another solution for my problem . You can define
$hasMany =>fields with list of desired fileds and it would not affect
the actual model [I hope so :) ]





On Nov 27, 2:41 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Nov 27, 2007 1:01 PM, WordPress Guru <[EMAIL PROTECTED]> wrote:
>
>
>
> > In the view.thtml of parent entity, it generates code  to display
> > related children. I do not wish to display all the fields of children,
> > so I have edited the view.thtml to accomadate that. However cake
> > generates the SQL every time using the models I have defined and when
> > I use DEBUG = 2 in core, I can see the dump , and this sql annoys me
> > becasue it gets all the fields from the dbase , no matter which ones I
> > am using.
>
> > Is there a way to restrict the fields. Now I know that when you use
> > findAll, you can pass fields array, but that is only for listing the
> > parent entity . The children are read as part of internal calls to
> > Model->read(null,$id).
>
> When you set $debug to 0 because you're going to be in production, it
> only reads in all the fields once and caches that list so it doesn't
> have to do it again.
>
> Hope that helps you understand the problem a little better.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to hand fileds in Model->read ...

2007-11-27 Thread WordPress Guru

Hello everyone,

I am into cakephp for a week so the question I am asking is very basic
one for most of you guys.

I have a parent child relationship , for which I use belongsTo and
hasMany. When I used the bake.php to generate my view.thtml for parent
and child.

In the view.thtml of parent entity, it generates code  to display
related children. I do not wish to display all the fields of children,
so I have edited the view.thtml to accomadate that. However cake
generates the SQL every time using the models I have defined and when
I use DEBUG = 2 in core, I can see the dump , and this sql annoys me
becasue it gets all the fields from the dbase , no matter which ones I
am using.

Is there a way to restrict the fields. Now I know that when you use
findAll, you can pass fields array, but that is only for listing the
parent entity . The children are read as part of internal calls to
Model->read(null,$id).

If the solution lies in defining the child model with get / add/
delete sql , I dont know how to do that ... becasue it would restrict
the ability of the child to display all fields when I am displaying
the models in their view ...

I would appreceiate your response.
Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: enforcing a parent

2007-11-23 Thread WordPress Guru

I dont know if the group is moderated. My previous mail did not appear
here so I am posting again.

Here is my problem , which is very similar to yours Julian.


I have a parent-child relationship , and as usual I have baked the
controllers and views using scaffolding. Like you I want to enforce
referential integrity. For this I have placed a link to add a child in
the parents view. The following link appears in view where parents
details are listed.

/child/addToParent/1

where 1 is the id of the parent to which the child will be added. Now
I have written a controller in the child named addToParent($id) and a
corresponding view add_to_parent.thtml to show the form.

Now in the controller function I can see the value of id is apearing
correctly. What I cant do here is to set the id of the foreign key
parent_id to id. I tried the following just before the save, which did
not worked.

 $this->data['parent_id']=$id

So my question is how can I set the foreign key.

The other thing I would ask is if there is a god tutorial that
describes the anatomy of cake. That will be grate. I am encountering
the problem becasue I dont know the basic anatomy and ways to
manipulate data in deifferent areas. All I could find is the manual at
cakephp.

Regards





On Nov 22, 11:23 am, julian <[EMAIL PROTECTED]> wrote:
> AD thanks for the input,  I believe I was misleading in my
> terminology,  I see I used the proase scafolding.  what i meand was
> the "standard views " you geat when you bake a view and specify no
> scafolding
>
> once again sorry for mixing up my terms
>
> Julian
>
> On Nov 22, 12:41 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > You don't, you write an application. Have a look at baking none-
> > scaffolding controllers/views, and edit what you get out.
>
> > hth,
>
> > AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: enforcing a parent

2007-11-23 Thread WordPress Guru

Julian, AD

I have similar problem. I have a parent-child relationship and I have
baked using scafolding as usual. I get the view of parent from where I
want to add a a child. So I have placed a link like

/child/addToParent/1

This link appears in the view of parent so that a user can click there
and add a child. This meas the parent id is preselected. Now I have
written the controller addToParent and the view add_to_parent($id) and
I can see that $id is being properly passed to this. What I dont know
heer is how to use that id when I am saving the data for the child.

I have tried $this->data['parent_id'] =$id  just before saving the
data. it does not work.

Besides the above problem I am wondering if there is a good tutorial
about the anatomy of the cake. The problem I am having is very basic,
and is because I dont know the basic anatomy of cake structure. All I
could find is the stupid manual:(


Regards
Cake Newbee


On Nov 22, 11:23 am, julian <[EMAIL PROTECTED]> wrote:
> AD thanks for the input,  I believe I was misleading in my
> terminology,  I see I used the proase scafolding.  what i meand was
> the "standard views " you geat when you bake a view and specify no
> scafolding
>
> once again sorry for mixing up my terms
>
> Julian
>
> On Nov 22, 12:41 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > You don't, you write an application. Have a look at baking none-
> > scaffolding controllers/views, and edit what you get out.
>
> > hth,
>
> > AD

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---