Frequently Asked Questions

What kind of sites can be built using ShortPHP?

Any kind of site. I'd still recommend using another framework if your plan is to build something big, but for small and simple projects ShortPHP should do fine.

What about ajax requests. Can I load a page request without loading the template?

Yes. If you add ?s_notpl to any URL that page will be loaded without the template file. Try it!

You can also specify that the particular request should be processed without the template file through the site file. By defining the string s_notpl as anything, that page will not have the template loaded: define('s_notpl',1); That's exactly what I've done in /blog/rss/ to make it just display XML code.

Can I have some global code shared between all site files?

Yes. If you create a file called shared.php in the root folder, that gets loaded in every request. It get's loaded after the output buffering starts but before the site file gets loaded.

Can I change which sitefile is used as a default if none is specified (if I don't want 'home')

Yes. If you define S_DEFAULT_SITEFILE in shared.php, that file will be included/called. Example: define('S_DEFAULT_SITEFILE', 'mysite');

Is there any bundled library or code that comes with the framework?

No, none what so ever. How ever I do have some helper functions (Ugly PHP code) which I commonly use with the core for some database functionality and some other short-hand functions, which I might include into the project as Add-Ons.

Can I follow this project on twitter?

Not yet, but you can follow me, the author, personally: @arnorhs.