FrostMVC provides a simple and easy-to-use structure for building web applications, with beginners in mind. It is designed to be simple to understand, yet flexible and modular. It comes with MySQL database access through the Model class and uses Twig for Views. FrostMVC is not open-source, but it is free to use for personal and commercial web applications.
index.php starts the framework in core/, which reads app/settings.php and app/routes.php.routes.php, which hands the request to a controller with View::route().View::get().FrostMVC keeps a small, flat file structure that is easy to navigate and customise:
The user space of the framework, where your models, views and controllers go, together with routing and configuration.
All PHP classes in app/ use your app namespace ($config['namespace']), e.g. MyApp\controllers and MyApp\models.
.php.twig).
Public files served directly to the browser: stylesheets, images and scripts. Link to them with {{ RESOURCEPATH }} in views.
assets/tmp holds runtime files such as logs (Logs::setDirectory('assets/tmp/logs') in the starter settings).
The framework itself. frostfw.php starts the app and routes the request, loader.php autoloads classes by namespace,
and classes/ contains the FrostMVC classes you import in your code, such as use FrostMVC\Model;.
Do not edit these files: replace the whole folder when you upgrade FrostMVC. Their methods are documented in the API Reference.
Your own reusable code and third-party packages. Classes go in libraries/ (namespace MyApp\libraries) and helper functions in
libraries/helpers/ (namespace MyApp\libraries\helpers\general in the starter). Load them at startup with $config['libraries']
in settings.php, or on demand with $this->require->library() and ->helper() in a controller.
Composer packages are installed in libraries/vendor: run composer install in libraries/. The starter uses Twig and PHPMailer.
FrostMVC namespace and your app classes in your own namespace, loaded automatically.settings.php builds a $config array and calls Site::addInstance($config), replacing the $instance->setURL()-style setters.View::route(BlogController::class, $pages) instead of a controller name string.Session::flash() / session.flash() for read-once messages.cache(), alias(), cast(), from() subqueries and forUpdate() row locking.DB options for SSL, sockets, ports, charset, connect timeout and automatic retries.Form::val(), Functions::default(), Date_Time::ConvertToTimeZone(), and the FlashLog key-value store.core/ folder and update the version in index.php.app/settings.php in the $config format (see Configuration) and choose a namespace.namespace MyApp\controllers;, MyApp\models, MyApp\libraries and MyApp\routes to your files, and import the framework classes you use (use FrostMVC\View;…).View::route('BlogController', $pages) to View::route(BlogController::class, $pages).session.get(...) + session.remove(...) pairs with session.flash(...).