[web] Best practice for dinamic site

Started by
11 comments, last by cignox1 14 years, 1 month ago
Thank you very much! Then I will go with the path thing.

Quote:Original post by Wan

Quote:Original post by cignox1
In short, and if I understand your example, what I don't know is the

(use page variable directly, or the extract category from page path)

part.

Heh, I didn't want to insert too much comments in between the code, so I kept it short and unclear. [grin]
I was just hinting at determining the category from the relative path:
programming/perl/pong.htm ->main category = programming, subcategory = perl

You probably already do that.


No, I don't do that now, because what I mean is that I did not know how to extract/store the category without having to explicitly declaring it in each link of the site. Using the path should work, and I will use a default name (i.e. links.html) for the related links section, to be found in each folder.

One last thing: currently I would specify each link as follows:

page.php?path=programming/programming.php

Is that the only way, or there are better alternatives?

Thank you again!
Advertisement
Using the CodeIgniter framework, a path like:
.../page.php?path=programming/programming.php
would be:
.../page/programming
What this does is load controllers/page.php and execute the function called programming. The programming function might load views/programming.php and print out your HTML.
Quote:Original post by Hodgman
Using the CodeIgniter framework, a path like:
.../page.php?path=programming/programming.php
would be:
.../page/programming
What this does is load controllers/page.php and execute the function called programming. The programming function might load views/programming.php and print out your HTML.


Nice, I will give it a look. I use now the path, and it works quite well for my pouposes.
Thank you all.

This topic is closed to new replies.

Advertisement