Hi,

I am using the ZF mvc pattern but a complete newbie,
and using my own code style in a lot of areas of my
site. I would like to make a simple ajax-based
functionality (using Prototype JS's "AjaxUpdater
function) . All I need to do is:

i) Write my code for the main page which will display
a div id which will be used for the ajax result (I can
do this from the view/controller scripts)

ii) use AjaxUpdater to call the url
"http://mydomain.com/myscript.php"; and return the
result in the above div

iii) Write the code for myscript.php to simply return
a result as pure HTML

The problem is, if I try to access
http://mydomain.com/myscript.php, it will not actually
go to the script, but instead ZF will look for
controllers and views of this script and try to
generate a new html page with the site's usual headers
and footers. This is because my .htaccess file has
been set up as described in the ZF newbie
documentation. However, I do not want html headers and
footers returned back..I simply want myscript.php to
return the html it is supposed to return... and
nothing else..as this html will be placed in the div
above.

So, the solution here is to create a public directly
called "my_direct_scripts" or something and store
myscript.php in that. I will then modify the .htaccess
file to EXCLUDE this directory from redirection, so
that scripts within it can be accessed directly. Then
my ajax function should work.

I just want to make sure I'm doing this the right way,
or if anyone would recommend something different?

Many thanks!


      

Reply via email to