PhpSlides / phpslides

Slides to the next level in PHP using PhpSlides, a light MVC fast framework.
Other
3 stars 1 forks source link
api php php-framework phpslides router slides

PhpSlide

Total Downloads Latest Stable Version License

Welcome to PhpSlides!
This framework is a PHP revolution, designed to provide a simple and scalable structure for developing full-stack web applications using the Model-View-Controller (MVC) architectural pattern.

With PhpSlides, you can write HTML, CSS, and JavaScript in a PHP-like way, streamlining the development process and enhancing productivity.

Table of Contents

Introduction

PhpSlides is a lightweight, easy-to-use full-stack framework that helps you build web applications quickly and efficiently. It follows the MVC architectural pattern, separating the application logic into models, views, and controllers to promote code organization and reusability.

Additionally, it provides the capability to write HTML, CSS, and JavaScript in a PHP-like way, making it easier to manage and maintain your front-end and back-end code together.

Features

Requirements

Installation

Install with Composer

composer create-project phpslides/phpslides ProjectName
cd ProjectName

Or Clone the Repository

  1. Clone the repository:

    git clone https://github.com/phpslides/phpslides.git
    cd phpslides
  2. Install dependencies:

    composer install
  3. Set up the web server:

    Point your web server to the document root.

  4. Configure the environment:

    If the .env file does not exist, copy the env example configuration file and update it with your settings:

    cp .env.example .env

Configuration

.env

Edit the .env file to configure database settings, application settings, and other configurations.

APP_NAME=PhpSlides
APP_VERSION=1.3.x
APP_DEBUG=true
APP_ENV=development

configs.json

{
    "public": {
        "/": ["*"],
        "assets": ["*"],
        "images": ["image"],
        "videos": ["video"],
        "audios": ["audio"],
        "styles": ["css", "scss", "sass"],
        "css": ["css", "scss", "sass"],
        "src": ["js", "ts", "css", "scss", "sass"],
        "png": ["png"],
        "jpg": ["jpg"],
        "svg": ["svg"]
    },
    "charset": "UTF-8"
}

Syntax

Creating Web Layouts

<?php

DOM::create('app')->root([
   ['id' => 'root'],
   Tag::Container([],
     Tag::Input(['type' => 'text'], '$$name')
     Tag::Text([], 'Hello $$name')
   )
]);

DOM::render('app');

?>

Styling Web Layouts

<?php

$style = StyleSheet::create([
   'RootStyle' => [
      Style::Size => Screen::100,
      Style::BackgroundImage => asset('bg.png'),
   ],
   'TextStyle' => [
      Style::Color => Color::White,
      Style::FontSize => Font::Base,
      Style::FontWeight => Font::Bold
   ]
]);

export($style, 'AppStyle');

?>

Creating Web Routes

<?php

Route::map(POST, '/index')
  ->action('Controller::method')
  ->name('index');

?>

Creating API Routes

<?php

Api::v1()->define('/user', 'UserController')
  ->map([
      '/info' => [GET, '@index'],
      '/{id}' => [GET, '@show'],
  ])
  ->withGuard('auth')
  ->name('user');

$user_id_route = route('user::1');

?>

Directory Structure

Here's an overview of the project directory structure:

project_root/
├── app/
│ ├── Controller/
│ ├── Guards/
│ ├── Forge/
├── public/
├── src/
│ ├── bootstrap/
│ ├── configs/
│ ├── resources/
│ │ └── views/
├── vendor/
├── .env
├── .env.example
├── .htaccess
├── composer.json
├── configs.json
├── LICENSE
├── README.md
└── slide

Documentation

For detailed documentation, including advanced usage, API references, and more, please visit our documentation website.

Contributing

We welcome contributions from the community! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b name/your-feature).
  3. Commit your changes (git commit -am 'Add a new feature').
  4. Push to the branch (git push origin name/your-feature).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Financial Support

Your contributions help us maintain and improve PhpSlides. If you find PhpSlides useful, please consider supporting us financially. Every bit of support goes a long way in ensuring we can continue to develop and enhance the framework.

Support Now!