On 18 May, Steve Sobol wrote:
> First, kudos are due to the Midgard development team. What a great
> piece of software this is! I can't wait to start putting it through
> its paces.

Thanks! I hope your Midgard experiences continue being
positive...

> Generating these links is easy. What I want to know is,
> when I click on, for example,
> http://my.midgard.admin.host/style/1234.html,
> how does Midgard know to pull up the Style Admin page and list
> information for style #1234?

The page /style/ is an active page, meaning that it
can take parameters from the URI path, like this:

        /page/arg0/arg1/arg2.html

In this case we use the ID of the style as the first
(and only argument). I don't have an Admin site before
me right now, but I'd assume that the /style/ page has
a code-init element (which is an element that gets parsed
before the actual style parsing at ROOT element begins,
see midgard-root.php3 for more details).

The code-init element has probably something like this
in it:

<?php

/* Check that the page had only one argument */
if ($argc == 1) {

        /* Fetch the style corresponding to the
                first argument in the argument array */
        $style = mgd_get_style($argv[0]);

}
?>

As you see, Midgard provides two variables, $argc
and $argv for handling the arguments given to active
pages. $argc contains the number of arguments given
as integer, and $argv is an array containing the
arguments.

/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]

Reply via email to