Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

PHP Template Design Pattern Help

Status
Not open for further replies.
Joined
Apr 26, 2005
Posts
7,412
Reaction score
151
Hi Guys

If I want to create easily reusable PHP template components, is it best to use a PHP object for each component? Can anyone link to a good tutorial on this?

Also, if I want to have a single PHP component that I can easily use across multiple sites, how can this be done?

Thanks :cool:
 
If your a complete beginner maybe start with something like

http://www.w3schools.com/php/

Tuts plus has some decent tutorials on php but you have to pay

A lot of great stuff is on YouTube as well

Are you just looking to include page elements like menus, sidebars footers etc

http://www.w3schools.com/php/php_includes.asp in a cpanel environment you can include files in multiple addon sites with the correct file path.

If your looking to build something serious in php, sites with user login database driven content follow a decent primer tutorial on php then jump in with a framework.
I highly recommend Laravel and this site has some amazing guides it looks complex at first but will save tons of time in the long run.
https://laracasts.com/series/laravel-5-fundamentals
 
Thanks. I'm not a complete beginner, I know how to do the standard PHP include. However, at the moment, I only know how to do this on a single site.

What I'm specifically looking at is ways to create a component based system that can easily be updated over multiple sites, e.g. all sites have a shared footer, and you only have to amend it once then all sites use the update.

Thanks
 
What I'm specifically looking at is ways to create a component based system that can easily be updated over multiple sites, e.g. all sites have a shared footer, and you only have to amend it once then all sites use the update.
Thanks

If the sites are going to be on the same cpanel then your standard include will work just enter the full path to the file

Code:
[COLOR=#007700][COLOR=#007700][COLOR=#007700]include [/COLOR][COLOR=#dd0000]'/home/somefolder/someotherfolder/footer.php'[/COLOR][COLOR=#007700];[/COLOR]
[/COLOR][/COLOR]


Alternatives would be to store you code in a database accessable by all the sites
 
Status
Not open for further replies.
Top Bottom