xentixar/xen-php

v1.0.0 2023-12-26 05:07 UTC

This package is auto-updated.

Last update: 2024-12-26 07:15:36 UTC


README

This is a simple starter template for PHP projects. It provides a basic directory structure and configuration files to help you kickstart your PHP projects.

Features

  • Directory structure for organized development.
  • Autoloading setup for efficient class loading.
  • Easy pagination.
  • Easy validation.

Getting Started

  1. Clone the Repository:
composer create-project xentixar/xen-php your_project_name
  1. Navigate to the Project Directory:
cd your_project_name
  1. Create a .env file:
cp .env.example .env
  1. Navigate to the .env file and configure database

  2. Navigate to the .env file and replace the 'APP_URI' value to your actual directory

  3. Navigate to the .htaccess file and replace the 'RewriteBase' value to your actual directory

  4. Run the project:

Start server and open browser and paste the following url :

localhost/your_directory

This should display a index.php page of src directory.

Directory Structure

your_project_name/

├── config/
| └── config.php
│ └── app.php
│ └── database.php
│ └── environment.php
│ └── pagination.php
│ └── rule.php
│ └── validation.php

├── public/
│ └── css
│ └── images
│ └── js

├── src/
│ └── index.php

├── vendor/
| └── composer
│ └── autoload.php
|
├── .env
├── .env.example
├── .gitignore
├── .htaccess
└── README.md

  • config/: Directory for the php configuration files.
  • public/: Directory for your assets.
  • src/: Directory for your PHP source files.
  • vendor/: Autoload files and composer dependencies if needed.
  • .env.example: Environment example file.
  • .gitignore: Git ignore file to exclude certain files/directories.
  • .htaccess: Htaccess file to redirect all requests to src directory.
  • README.md: Project documentation file.

Usage

  1. Add Your Code:

    Add your PHP code files inside the src/ directory.

  2. Don't forget to include autoload.php file of vendor directory

  3. To use pagination refer to the following link: Easy Pagination in PHP

  4. To use validation refer to the following link: Easy Form Validation in PHP

  5. Start Coding:

    Start building your PHP project!

Contributing

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Commit your changes: git commit -m 'Add new feature'.
  4. Push to the branch: git push origin feature-name.
  5. Submit a pull request.

License

This project is licensed under the MIT License. Feel free to use and modify it according to your needs.

Happy coding!