Re: best way to implement a navigation
| From: | Hans H. Anderson | Date: | Tue, 18 Jul 2000 23:37:48 +0000 |
| Subject: | Re: best way to implement a navigation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7181@lists.php.net to get a copy of this message | ||
Sam,
From reading the several posts from you and those who responded to you,
'include' does sound like what you want. Instead of dynamically replacing
text, the PHP pre-processor just includes the contents of the file
specified. I have one I always put in called 'header.inc' and I put in at
the start of every page. Then, for instance, if I want to change the
bgcolor for the page, which is specified in the header, it's trivial to do
so in one spot. And it goes way beyond such small changes as that. My
navigation systems tend to be at the top or left of pages, and thus I
usually include them in the header.inc file, too. This header.inc file,
of course, has lots of PHP code of it's own, in addition to HTML and such.
Hans
On Tue, 18 Jul 2000, Sam Carleton wrote:
> php3@developersdesk.com wrote:
> >
> > Addressed to: Sam Carleton <scarleton@activex-dev.com>
> > php <php-general@lists.php.net>
> >
> > ** Reply to note from Sam Carleton <scarleton@activex-dev.com> Mon, 17 Jul 2000
> > 19:13:31 -0400
> > >
> > > Can anyone point me to some examples or tutorials of implementing
> > > navigation in PHP such that once it is implemented effort to maintain
> > > it is minimal? I have seen some mod_perl code that allows you to
> > > create a text file with a links/relative URL per line and all you have
> > > to do is include <!--#NAVBAR--> in the html document that is read by
> > > the perl module.
> > >
> >
> > Take a look at:
> >
> > http://www.php.net/manual/function.include.php
> >
> > Include works about the same way in PHP.
>
> I am sorry, I don't think I explained it correctly. The navbar example
> using mod_perl is such that you create a handler of some sort, in my
> case it handles all *.html files. The handler looks for the
> <!--NAVBAR-->. Once the handler finds that comment, it replaces the
> comment with the navbar.
>
> I have PHP compiled as a loadable module thus it is my understanding
> that handlers cannot process the php file before or after the php
> handler. Because of this I am assuming that I am going to want to use a
> php include to include php code that dynamically creates the navbar.
> All this I already knew...
>
> I am wondering if there are any examples of this type of thing or if
> there is a better way of implementing a navbar in php.
>
> Sam
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
Hans Anderson ~ me@hansanderson.com
PO Box 426, Missoula, MT 59806 | PHP, Search Engines, SQL
(800)397-9116 / (406)549-6524 | Databases, Flash Multimedia,
http://www.hansanderson.com | Killer Audio Production,
http://www.goofiness.com | Minty Fresh Breath.