-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started
Start here to learn the essentials about developing web applications with Framy.
The default Framy application structure is intended to provide a great starting point for both large and small applications. Of course, you are free to organize your application however you like. Framy imposes almost no restrictions on where any given class is located.
In the root directory is every file of the project and Framy.
Inside the app directory, as you might expect, are all the core Class of your code and Framys.
However especially for you its required to know that specially folder custom is for you. Because you are Special. Happy Birthday.
The config directory, as the name implies, contains all the config files. It's a great idea to read through all of these files and familiarize yourself with all of the options available to you.
The public directory contains the index.php file, which is the entry point for all requests entering your application. This directory also houses your assets such as images, JavaScript, and CSS.
The routes directory contains the files web.php and api.php. Where you register the web an api routs.
The storage directory contains your views as well as your raw, un-compiled assets such as LESS, SASS, or JavaScript. This directory also houses all of your language files and everything else you want to store.
The app Directory which contains the core code of Framy. In the following topics I will shortly explain what the components, in the Component folder, are meant to do. The folder is called like that because the folder needs to mach with the namespaces and component sound better in an namespace.
Is the house made auto loader currently only supporting PSR-0 standard.
Made to simplify interaction with config files.
Communication with every type of Database under usage of Medoo.
Routing as we know. you can use a self made routing tool or you can use Klein.
Standard Library with some basic function like an simple validation trait or different Objects like ArrayObject for an better work with array in this example. And exception classes.
Specially to profile your code. As the name says its basically an Stopwatch for your code witch manny extra features.
To work with files and directory's.
Templates with different bridges like Smarty or mustache
Validate data.
Quite at first you should register the route. You can read how to exactly do this under Routing. But here an example:
$klein->respond("GET", "/", function(){
view("welcome");
});Inside the function can everything happen like calling an method from an class. In this example we will not do this.
We will just use the view() helper function and display the "welcome" template
To do this we need to add an Template. Lets name it welcome.tpl (.tpl ending -> syntax Smarty requires)
We add the file under storage/templates.
welcome.tpl shall look like this:
<head>
<title>Framy</title>
</head>
<body>
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title m-b-md">
Framy
</div>
</div>
</div>
</body>
</html>Klein Documentation.