diff --git a/README.md b/README.md index 8e838cd..e9e273d 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # PhpSlides -***PhpSlides*** is php framework mainly designed for already created foundation templates used in creating of `Router`, `Api` and `database management` 💫. +**_PhpSlides_** is php framework mainly designed for already created foundation templates used in creating of `Router`, `Api` and `database management` 💫. -Use ***PhpSlides*** in creating of Very based secured Router, Api & database, created inbuilt template database which accepts - `MySql` & `Sqlite` database 🔥✨ can also setup other database. +Use **_PhpSlides_** in creating of Very based secured Router, Api & database, created inbuilt template database which accepts - `MySql` & `Sqlite` database 🔥✨ can also setup other database. It has by default in preventing SQL injections, it prevents project from XXS attacks & CSRF 🔐. -It's a good practice for a beginner in Php to start with ***PhpSlides*** +It's a good practice for a beginner in Php to start with **_PhpSlides_** ## How PhpSlides works: -- With PhpSlides, all request coming from the server are redirecting to PhpSlides for verifing routing. +- With PhpSlides, all request coming from the server are redirecting to PhpSlides for verifing routing. And checks if request matches the registered routes, else it returns a 404 Not Found Page 📌. - No request can access any files or folders in a PhpSlides project unless specified in routing 📌. @@ -22,10 +22,9 @@ It's a good practice for a beginner in Php to start with ***PhpSlides*** - Read PhpSlides default codes and understand each codes function, codes are neat and readable 💯. - ## PhpSlides Examples & Explain -Firstly, we create our Slides Project by executing this command in your Terminal +Firstly, we create our Slides Project by executing this command in your Terminal if Composer is already installed. ```bash @@ -36,26 +35,29 @@ Where the `slide_project` is the project name you which to create & it's the pro And it's going to create the project with the specified name at the target directory where you install it If composer is not yet install. Install it by executing: + ```bash pkg install composer ``` + And we're all setted. We would open our project on vscode or PhpStorm or any other Php editors. -Let's start our project on browser, you would setup & start the Apache server in your Xampp or any other Php server. +Let's start our project on browser, you would setup & start the Apache server in your Xampp or any other Php server. If you're using phone, you may use AwebServer for Php server. And open the host in your browser, you would see a default template. ## Routing -There are different methods of Request Route. +There are different methods of Request Route. This Route methods are used receiving request from the client side + - GET Route - POST Route - PUT Route - UPDATE Route -- DELETE Route +- DELETE Route - VIEW Route _(almost the same as GET)_ - REDIRECT Route @@ -64,22 +66,22 @@ This Route methods are used receiving request from the client side Open the `routes/route.php` file in your editor. Open the `routes` folder, the the `route.php` file. By default you'll see a dashboard route been registered, you may remove it to start from scratch. -Let's create a simple blog slides as example. +Let's create a simple blog slides as example. So we would register our routes, we would need a `Login Page`, `Register`, `Profile`, and `Posts Page`. Let's register pur routes in the `route.php` file and write example: ```php (slides) ``` @@ -90,7 +92,7 @@ Firstly we imported our autoload file from the vendor directory so we can use al With `use PhpSlides\Route` we use it in importing our Route class to use. The `Route::config` function must be specified at the beginning of our codes. -It makes PhpSlides to configure our website Routes and makes it very secured +It makes PhpSlides to configure our website Routes and makes it very secured which allows to to have access in configuring the routing and the requested paths. The `Route::config` function takes 1 Boolean parameter which indicates whether to allow Logs request. @@ -100,7 +102,7 @@ And the `Route::view` function allows you to create a view route. The parameters passed to it, will be two, the first parameter specifies the route that should be requested to render the second parameter. -The second parameters render the files in the view directory which can be accessible with __::__ (___Double Colon___) and the file name. +The second parameters render the files in the view directory which can be accessible with **::** (**_Double Colon_**) and the file name. Any files we creates in the view directory must be in the format `fileName.view.php` which the `fileName` is the name of the view file and the `.view.php` is the file extension, so PhpSlides will notice that it's a view file. @@ -114,29 +116,29 @@ Then we can write a small example HTML code.