User:Miladxandi/sandbox

= Simplist  =

Simplist is a mini framework based on PHP language for small projects.
We strongly suggest our framework for personal blogs, news agencies & human resource management.

Just like any other PHP framework we started this project based on MVC architecture with the featured services like ,   |   , SharedLayouts, Middlewares & pre-defined security. Everything in Simplist is as simple as installing it on your server! Want to help in development?

= Documentation =

Installation
Remember your PHP version should be upper than 7 and the local request address should be set on:

After that, you have to set the username & table of your Database! in a local project for first use, these values should be just like this:

You can change these values by going to Model layer and change them in Database.phtml in Connection folder, or go to this address:

Note: There is a SQL Table file in “Resources” folder that you can easily import it to your local or online MySQL database

Until you`re working on local a working directory, the HTTPS protocol is turned off, but if you want to upload it on your server, the HTTPS protocol can be turned on by making the “SecureProtocol”  in the Middleware list, at the Important Folder you can find a Security file, or go to this address:

You can change the  to

It`s completely installed and ready for use.

Routing
To define your own routes, go to this address:

There is just an array returner that returns the url as an array key and configurations as its values. Every new route should exactly create from this template: Let me describe it line by line:

Note: Controllers and Middlewares have to create with exactly  or   extensions, but should be written here without these extensions. For example, we have “HomeController” but we can access it by writing just its name without the “Controller” extension: “Home”

or

oLoad
The  library is a Simplist service and defined to help your html   section be more clean. if you need to use this library, you have to use this code in your view file at first:

In this code, you can define different locations for your JS, CSS, Images and etc. As we let you customize your app, the  will show you the default root of these contents, but you can change it in every page that you`re creating it.

This code can import external JS or CSS libraries or Images.

Also, it can add unique types of files to your project.

This is a complete code to show how can you show an image on your html:

This Code means:

And will create a complete  tag anywhere it used.

You can add JS and CSS libraries just like this; But except everything after the  argument in that method and their own extensions like this:

The  argument let you define internal or external libraries or images. if there is no need to define, just leave an empty double quotation  or pass null as its argument.It`s null by default.

The  argument means the library or image is a local file or not, The system will use the default root with the given argument to find that file if the   was.

The  argument must be   if the extension were everything except js, CSS, png, jpeg, jpg, and ico. It`s  by default.

The  extension will create complete   code everywhere you call it. The  extension will create complete   code everywhere you call it.

SharedLayouts
SharedLayouts is name of a Simplist service that is in the Shared folder in View Folder.

It contains 2 folders and a .phtml file with “Layouts” name by default. The Layouts file can contains one or more classes for each part of project. for example there is a class just like this:

It includes some methods to load some other view files as header, menu and footer. There s no complex concept. 