On 26 Mar, Miles Scruggs wrote:
> Hey all,
Greetings!
> Could someone talk on the code-* elements ( ie
> code-compat ). They are talked about quite a bit in the mailing list
> but I�m still searching for a place where they are defined. Are they
> just style elements that I can create and enter code into them?
Yes, you can do pretty much whatever you want with them.
The only difference between regular style elements and
the code-* ones is that they (code-compat, code-global and
code-init) are called directly from midgard-root.php3, just
like the ROOT element is.
> What is their purpose, other than the fact that I�m suppose to put my
> phplib calls in there?
Their usefulness comes from that they are called in before
the regular style, ie. before any data is sent back to the
browser. This means that you can set additional HTTP headers
(using the PHP header() function), or set variables used
by your style elements and pages there.
The convention has been to used the three in the following
way, but of course you're free to utilize them the way
you want to.
code-compat - compatibility code for migration between
different Midgard versions, etc. I've seen this
in use in only a couple of places.
code-global - code that is common to your entire site. If
you want to have some custom functions, etc. available,
this is a good place to put them.
code-init - code specific to a particular page. This is
very often used for handling arguments sent to
active pages.
> Miles Scruggs
/Bergie
--
-- Henri Bergius -- +358 40 525 1334 -- [EMAIL PROTECTED] --
http://www.iki.fi/Henri.Bergius
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]