You are here: Re: Managing includes « HTML « IT news, forums, messages
Re: Managing includes

Posted by Neredbojias on 06/28/07 12:19

On Thu, 28 Jun 2007 07:56:46 GMT Toby A Inkster scribed:

> Neredbojias wrote:
>
>> I see no advantage to this. What is wrong with just inserting the
>> path as you do in a link, eg: ../par_dir/somefile.html?
>
> Firstly, consistency. If I want to include "navigation.php" from
> "/index.php", with your system you have to write:
>
> include "includes/navigation.php";
>
> but if you want to include the same navigation menu from
> "/birds/parrots.php" then you need to use:
>
> include "../includes/navigation.php";
>
> The path is different, you see. Now, say my site takes on more of a
> parrot focus, so I decide to move "parrots.php" out of the "birds"
> directory and into my site's root directory, then this breaks the
> include path, and I need to change it.
>
> Using include_path makes maintenance a lot easier. I put
> "navigation.php" into a directory listed in my include path, then I
> can use it on "/index.php" or "/birds/parrots.php" like this:
>
> include "navigation.php";
>
> without having to specify the path to it. I can then move my
> "parrots.php" file about as much as I like, and don't need to make any
> changes to it.
>
> This is much the same way that C programmers work. They specify the
> file name of a library they want to include, but not the full or
> relative path to it. They rely on the build environment to specify the
> location of all the library files.

I can see the advantage to having multiple paths comprise the include
path. Long ago, there was even a DOS command which did virtually the
same thing (-joining directories.) But my real objection is that this
convenience kabashes the ability to hand-list a path and have it work as
does a link, which is intuitive. If the forefathers of modern html had
really been sharp, they would have allowed for both. (Eg: any non-pathed
file listing would seek the current directory and any directories in the
include path while a pathed url would only access that directory.)

--
Neredbojias

Once I had a little dog
Who wagged its tail spritely.
But it walked by the harvestor
And now is shorter slightly.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация