I might be able to help with the first issue. I develop my ZF site on
my laptop (localhost), and the live site is on shared hosting. Here's
how I have it set up:
Both the localhost and shared host have the same directory structure,
which is mostly the same as recommended in the docs:
application/
configs/
modules/
default/
blog/
...
data/
library/
public/
tests/
On my localhost, the absolute path to the project is
/Users/Steven/Sites/site.name/
And, in Apache's conf file, I set the DocumentRoot to
/Users/Steven/Sites/site.name/public
The absolute path on the shared host is
/home/steven/www/site
And Apache's DocumentRoot is set to
/home/steven/www/site/public
Having the DocumentRoot point to the project's "public" dir puts the
library outside of the web root, so you'll always have to call includes
using a relative path like
"include('../library/Zend/Controller/Front.php');". AFAIK, this is the
recommended structure for ZF projects. Making a symlink, within
public/, to the library is a bad idea as it will allow the library files
to be read from the web.
I hope this answers the first couple of questions. As I'm still
learning Zend_Form, myself, and know nothing about AJAX/Dojo, I'll let
someone more knowledgeable than myself take a crack at those.
Cheers,
-- Steven
Giovanni A. D. wrote:
Hello,
I'm a zend framework noob and I'd like to understand a couple of
things that are not clear to me yet. I've read the quickstart
documentation document on how to setup the framework and I've also
learned how to do it using zend tool but the documentation always uses
absolute paths so I'd like to which is the best way to achieve this:
- having the website not on the web root (on my local apache I've it
like /test/zend/my_test/test01/ ...)
- having the library folder outside my project (just make a symbolic
link or better to change config files?)
I've found this message:
http://www.nabble.com/forum/ViewPost.jtp?post=11117463&framed=y
that suggests to define a/use the "BASE_PATH" constant.. and this
should answer to my first question.. but is not clear to me if this is
the best method and if yes, I wonder why this is not used / showed in
the quickstart tutorial..
and also.. from my test with the guestbook example I've changed the
_getGuestbookForm method adding:
$base =$this->getRequest()->getBaseUrl();
$form->setAction($base.$this->_helper->url('sign'));
..cause else it didn't worked correctly if it was on a subdirectory..
so which one is the best to use? getBaseUrl() or
BASE_PATH.$this->_helper->url('sign') or .. ?
and how do you handle this usually inside views?
I've also thought to use the html base tag in the header but not sure
that is the best method..
Also in that example there is a forms folder with the form code..
which are the best practices to handle that kind of things? Is that
(having a form folder) the best one or which one do you like the most?
All this confusion makes it also more confusing to me the approach to
dojo.. I've did some tests and was able to successfully ran some
examples that used Dijit but not sure I did that in the best way.. but
maybe I'd better to send another message dedicated to that topic.
Thanks for now for your answers and tips and sorry if my English is
not perfect but I'm from Italy :p
ciao,
Giovanni.