On 7/17/07, minglee <[EMAIL PROTECTED]> wrote:

1. Because ZF is using rewrite, how should I call the server-side action,
for example:
If I want to call registerAction in
/topath/application/controllers/visitor.php, can I call like
"/visitor/register"-- my .js file is in /topath/public/script/?


Yes, that will work fine.  Your javascript function can send the
XMLHttpRequest to any valid URL that you can access with a web browser.

2. After handle the HttpRequest in visitor.php, how shall I output HTTP
response, shall I use something $view->render() or just "echo $response;"
?


I have a small writeup at http://dewoods.com/blog/view/id/3 showing how I
use Zend_Json to return a response to an AJAX request.  If you just want the
output of a view to be returned, then you don't have to do anything because
the new viewRenderer helper will automatically do the equivalent of calling
$view->render() for you.

Dillon

Reply via email to