On Sep 24, 2008, at 4:57 AM, Bart McLeod wrote:
Hi Ian,
I would help if you had some line breaks in your message... :-)
Oh. Weird. I don't know why that happened. I've had an amazing
amount of trouble with this list-serv! I don't know why. I assure
you that I can usually write an email, and I was actually very proud
of my paragraph breaks, especially. :)
Thanks, Bart. I'm trying to pick up on ZF, and the terminology is
really slowing me down. But I'll re-read your email and any parts of
the Reference Guide I can think of, looking for more information on
this. It makes sense, if that's something that can be done!
If anybody was turned off from reading my question because of the line
breaks, I think I've got it figured out, here it is again:
-ian
-------------------------
Hey there all --
I've been trying to understand ZF recently and I am having trouble
wrapping my mind around something. I think it'll be easiest if I
quickly explain how I usually do things:
I run a website for a small alt-weekly and have come to think of
pieces of my layout as separate little "objects" with methods and
properties. I have php classes like "articles","comments","guide" and
"calendar" which correspond to tables in a database, and which can
execute logic based on arguments given and return an HTML output string.
So on any given page displaying, say, an article about turtles*, might
be comprised of objects which display the article itself, a list of
related articles, a box listing recent comments about the article,
links to listings in our town "guide" relevant to the article,
relevant calendar listings, etc., based on arguments passed through
the URL to the controlling page, and to the objects inside.
It seems like each of these objects sort of follows the controller/
action concept, if they were individual pages, rather than objects
returning HTML. And I might want to use these same "objects" in
different context on a different section of the site, so I like having
these php classes to turn to, and I'm not duplicating the code.
Now... is that what "modules" are in Zend Framework? Would it make
sense to turn my "articles", "comments" (etc.), my php classes into ZF
modules? They certainly have their own structure, logic and actions.
Though I haven't designed it that way originally, I could see how each
could be divided into an MVC pattern and I think I like it.
Now, if that is the case, how to I go about creating that master page?
I suppose I could have a controller page and in actions for that page,
make calls to the various modules. Like "/weekly/read/..." or "/
calendar/display/...", which would feed arguments to the modules,
which would return HTML; but is there an intended way to simply return
the view's HTML output, say, in a method of the module? Where would I
find that way? Or is it a bad idea? I would love if someone could
point me in the right direction here... I'm having trouble with some
of the terminology and not positive where to focus my studies. Maybe
it's not modules at all.
Any help would be much appreciated, as I keep coming back to this same
issue.
Thanks in advance,
Ian R
*this is not a very realistic example, but seeing it now, I wish that
it were.