Download the PHP package optiwariindia/website without Composer
On this page you can find all versions of the php package optiwariindia/website. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package website
website
The concept
It's a composer based basic boilerplate code for PHP 7/8 development.
Installation
To install using composer use following command
How to use
Setup
Configure setup page for your project. The predefined strucutre checks the required php extensions, apache modules, cofiguration files and email/database connectivity parameters. You can extend setup class as below:
Config
The config class is designed to store basic configurations of the application. It stores database configuration, email configuration, API Keys, Encryption keys, Integration parameters and other static resources that are not frequently changed and hence cannot be saved into database. You can extend config class as below:
Request
This class is designed to handle request parameters like inputs, method, timestamp, url, useragent and action parameters. The class can be extended to use in your project as below:
Session
This class is designed to manage user's session using PHP Session variables. This class takes care of initialization of session only once in the page, store parameters into your session variable and fetch them whenever required. The class can be extended to use in your project as below:
View
This class is designed to manage views using twig template engine. Besides twig template engine, it also takes care of JSON outputs and HTML Output as variable. You can extend this class as below:
Setup view directory
Render a page
Read HTML Page into a variable
Generate JSON Output for API
Module
This class is created to create plugable modules in your project. This class provides support of basic functions related to database and debugging. This class is dependent on optiwariindia\database and mysqli extension. You can create plugable modules by extending this class to your module as follows:
Debug option
You can use trace method to dump a variable in json format and stop execution of the code at the point as shown below:
class module1 extends optiwariindia\website\module {
public function someFunctionName(someParameter){
//Some operation here
self::trace(VariableToBeTraced)
}
}
Connecting Database
You can use init to initalize database within any module and get access to methods select,insert,update,delete and query as shown in example below:
class module1 extends optiwariindia\website\module {
public function FunctionName($requiredParameters){
$db=self::init();
$info=$db->select(table,fields,clauses);
}
}
We welcome suggestions and enhancements. Thanks for you cooperation