Jump to content

User:Miladxandi/sandbox

From Wikipedia, the free encyclopedia
Simplist
Developer(s)eastCloud LLC.
Initial releaseJune 2011; 13 years ago (2011-06)[1]
Stable release
2.5.2[1] / March 28, 2018; 6 years ago (2018-03-28)
Written inPHP 7[a]
Operating systemCross-platform
Available inPHP
TypeWeb framework
LicenseApache License
Websitesimplist.ir

Simplist

[edit]

Simplist is a mini framework based on PHP language for small projects.

[edit]

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 $Add->Loader , gVerb | pVerb , SharedLayouts, Middlewares & pre-defined security. Everything in Simplist is as simple as installing it on your server! Want to help in development?

Documentation

[edit]

Installation

[edit]

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” true in the Middleware list, at the Important Folder you can find a Security file, or go to this address:

You can change the $this->CoreSecurity->SecureProtocol(false); to $this->CoreSecurity->SecureProtocol(true);

It`s completely installed and ready for use.

Routing

[edit]

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:

'/aboutus' => [
 'target'=>'Main.Home.Aboutus',
 'gverb'=> 'GET',
 'pverb'=> 'POST',
 'middleware'=>'Main.Home.Aboutus' ],

Let me describe it line by line:

'/aboutus'

'target'=>'Main.Home.Aboutus'

Note: Controllers and Middlewares have to create with exactly Controller.phtml or Middleware.phtml 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”

'gverb'=> 'GET' or 'pverb'=> 'POST'

'middleware'=>'Main.Home.Aboutus'

Features

[edit]

oLoad

[edit]

The oLoad library is a Simplist service and defined to help your html head 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 <img> tag anywhere it used.

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

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

The Local 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 Local was true.

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

The js extension will create complete <script src="../../../Script/Main/main.js"></script> code everywhere you call it. The css extension will create complete <link rel="stylesheet" type="text/css" href="../../../Style/Shared/File.css"> code everywhere you call it.

SharedLayouts

[edit]

SharedLayouts is name of a Simplist service that is in the Shared folder in View Folder(public_html/View/Shared).

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.

  1. ^ a b Milad Xandi (April 8, 2018). "معرفی چارچوب ایرانی Simplist". virgool.io. Retrieved May 10, 2015.
  2. ^ "A PHP project for creating online blogs in the most easiest way". simplist.ir. Retrieved August 29, 2015.
  1. ^ PHP version 7 or newer is required for Simplist versions 2.5.2 and older [2]