/    Sign up×
Community /Pin to ProfileBookmark

CMS include() structures – templates

In my CMS file index.php selects a module. The list of actions:
– include kernel.php
– echo <html><head> … to </head><body>
– include skin’s body.php (it includes a file which selects a module or category)
– echo </body></html>

Index.php is used for most modules (except admin.php, login.php…).

Site addresses looks like:
– index.php?mod=arts&id=5
– index.php?mod=user&id=1

I think about changing it if there are better solutions. I want to allow modules and plugins put their code into <title>, <head> and before <html>. However, more important is allowing them to select if they want to use the whole layout or information <div> or Header(“Location: …”).

I used the following code in <head></head>. However, I can include it before <html>.

[code=php]
if($_GET[‘mod’])
{
@include(‘plugins/’.$_GET[‘mod’].’/head.php’);
}[/code]

Is it good solution?

[b]Other way.[/b]
The main files would be modules’ files, e.g. art.php, file.php. Addresses like:
– art.php?id=7
– user.php?id=4

The disadvantage of it is repeating code for displaying layout in every module / file. Maybe there are better solutions similar to these.

What do you think about it? What advices can you give me? Do you have other solutions?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @WebCM spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...