Mm... Not quite right. To put it easily, here’s how:

 

First, read about MVC in the CakePHP manual. It gives a big picture about the whole web thing.

 

From what I understand, what you’re trying to do is to add a logic (code that processes objects and stuff) into your view (the THTML file). While possible, this is NOT a preferred way.

 

All of the logic (including any functions) need to be placed on the controller.

 

The controller will pass data to the view via $this->set(‘key’, ‘value’) method.

 

The view will never need to process anything but the values set from the above method.

 

The less the client (or the view) need to know about how to process data, the better your solution would be. Don’t hesitate to send back the data/tag/extra info to the server (using POST - <form> or GET - <a href>). That’s just the way the web works.

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of ??? Yang Su Li
Sent: 04 Nopember 2006 15:43
To: [email protected]
Subject: Re: how to call a function when somebody click a link?

 

thanks & kissssssssssssssssssss :)

 

so you  think the form and _javascript_ thing didnot work out because of arguements missing?

 

2006/11/4, Adrian Godong <[EMAIL PROTECTED]>:

Your second solution (the one setting up a flag) is the best way to do that. Don't forget to set any additional data you need in the session.

What you need to understand is like this: the client does not anything about your program. Period. It does not even know the original data (the one that resides in $this->blablabla). This is called stateless. Therefore, the server must maintain the data within the session variable for cross-page functions.

On 11/4/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:


5555555555555555555

i want to redirect the user
back to the page they were just on,with calling a function in
advance....:(

maybe i should learn more about basic php?




--
Adrian Godong
[EMAIL PROTECTED]

Microsoft Student Ambassador

<br


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to