-- Bob Linkonij <[email protected]> wrote
(on Sunday, 07 June 2009, 05:59 PM -0700):
> I'm new to the Zend Framework, and to be honest frameworks in general.
>
> I've been running the various pieces of my small company's web site
> each in their own dedicated directories under the public root on the
> web server.
>
> I'm now looking at building a "front end" for a more organized web
> site using the ZF rather than just a loose collection of different
> applications. I understand that the Controller is what organizes what
> goes where.
>
> I've been told that when using the ZF I should keep as much as
> possible OUT of the public web directories and not even use the
> Webserver's configuration aliases. Instead I should use the ZF to
> "point" to stuff.
>
> So far, applications like DocuWiki sit entirely IN the public area of
> my web site. So if I access http://website.com/wiki, the DocuWiki
> application files are all at/below /path/to/public/webroot/wiki.
I've done this sort of thing with a few apps (using them inside ZF in
order to benefit from things like shared layouts), and it's typically
been a huge pain. I've blogged about it:
http://weierophinney.net/matthew/archives/138-Start-Writing-Embeddable-Applications.html
There are some hacks you can do to make it work, but typically, unless
the application has an "embedded" mode, it's very hard to get it to work
correctly, and often easier and more performant to simply maintain
multiple sets of your layouts, one per application you want to embed on
your site. (eww!)
Also, because of the way these applications usually work, you can't
typically get around installing these apps below the document root. I've
tried many times. Best just to forget about it and move on.
When you do, install the apps in directories *below* the document root.
Per your wiki example, you'd install just as you did before. Most of
these applications come with rewrite rules -- I move these to the
.htaccess in the document root, and have them precede those for my ZF
application to ensure they are matched and dispatched first.
# app-specific rules go here:
RewriteRule ...
# ZF rules go here...
Hope that makes sense -- and good luck!
> I'm having a hard time grasping the whole MVC approach of the ZF. I
> still want to end up with the wiki @ http://website.com/wiki, but if I
> move the files somewhere else, how does the ZF "point" to them?
>
> I learn best if I can tear into an example, so if anyone could comment
> or reference any good ones, I'd really appreciate the help!
>
> From all I've read I'm pretty sure the ZF will help a lot with getting
> me in the direction I need to go; just need to teach an old dog some
> new tricks first I suppose.
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/