Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keeping PHP script separate from UI

Tags:

php

templates

I have php scripts that do things like register, login, upload. I would like to keep the HTML in a seperate file so that say I make a desktop client I can just use the php files to do the login register etc.

Basically to have say a front end, the HTML or desktop client and then only one backend, the php.

Is that possible?

EDIT : Would something like ASP.net be more suited to this?

like image 282
Jonathan. Avatar asked Mar 14 '26 08:03

Jonathan.


1 Answers

Don't just jump on a Framework bandwagon. The creator of PHP himself advocates a no-framework approach to dealing with this separation issue. See: http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

The problem with general frameworks is they're unnecessary and slow. It's fine if you're specializing in a single domain such as a CMS and using drupal or something, but be wary of general frameworks. Be especially worried about the uselessness of Smarty (see: http://codeangel.org/articles/simple-php-template-engine.html)

Before you go off on me, keep in mind that I'm not anti-Kohana, ZF, etc. They still have their uses. But since people tend to just tell people to jump straight to using a framework, I thought I'd offer a different perspective.

like image 65
rkulla Avatar answered Mar 16 '26 21:03

rkulla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!