PHP Classes

Nano PHP Framework: Build applications with the minimum amount of code

Recommend this page to a friend!
  Info   View files Example   View files View files (22)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-08-10 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 35 All time: 10,898 This week: 73Up
Version License PHP version Categories
nanophp 1.0MIT/X Consortium ...5PHP 5, Libraries, Design Patterns
Description 

Author

This package provides a framework to build applications with the minimum amount of code.

It provides several classes that implement common features that PHP applications need, so developers need to develop applications.

Currently, it provides classes to:

- Controller classes to implement a user authentication system and processing strings

- Model class to store and retrieve user data

- View scripts to display the output of applications to Web pages

- Configuration classes to load the values of application details

Picture of Juan Camacho
  Performance   Level  
Name: Juan Camacho <contact>
Classes: 5 packages by
Country: Spain Spain
Age: 44
All time rank: 4118112 in Spain Spain
Week rank: 362 Up11 in Spain Spain Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php

require_once 'src/Config/Database.php';
require_once
'src/Controllers/AuthController.php';

use
src\Controllers\AuthController;


// Handle login form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['username'], $_POST['password'])) {
   
$authController = new AuthController();

   
$username = $_POST['username'];
   
$password = $_POST['password'];

   
$user = $authController->login($username, $password);

    if (
$user) {
       
print_r($user);
       
// Successful login, token and cookie are generated.
        // Redirect to the protected page or handle the result accordingly
       
header('Location: protected_page.php');
        exit();
    } else {
       
// Handle login failure, show error message
       
$errorMessage = 'Invalid username or password';
    }
}

// Render the login form
include 'src/views/login.php';

?>


Details

NanoPhp

NanoPhp is an attemp to minimalist PHP framework designed to provide a lightweight and flexible foundation for web application development.

Features

  • Basic MVC (Model, View, Controller) structure.
  • Stateless auth approach.
  • Minimalistic configuration setup.

Requirements

  • PHP 7.4 or higher

Documentation

  • Auth ? Authentication Class.
  • Str ? Strings helper Class _(string manipulation, parse, comprobation...)_

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.


  Files folder image Files  
File Role Description
Files folder imageDocs (2 files)
Files folder imagesrc (4 directories)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file middleware.php Example Example script
Accessible without login Plain text file protected_page.php Example Example script
Accessible without login Plain text file Readme.md Doc. Documentation
Accessible without login Plain text file register.php Example Example script

  Files folder image Files  /  Docs  
File Role Description
  Accessible without login Plain text file Authentication.md Data Auxiliary data
  Accessible without login Plain text file Str.md Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageConfig (2 files)
Files folder imagecontrollers (2 files, 1 directory)
Files folder imageModels (1 file)
Files folder imageviews (2 files)

  Files folder image Files  /  src  /  Config  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file Login.php Class Class source

  Files folder image Files  /  src  /  controllers  
File Role Description
Files folder imageStringControler (7 files)
  Plain text file AuthController.php Class Class source
  Plain text file StringControler.php Class Class source

  Files folder image Files  /  src  /  controllers  /  StringControler  
File Role Description
  Plain text file CaseTrait.php Class Class source
  Plain text file CheckersTrait.php Class Class source
  Plain text file CountTraits.php Class Class source
  Plain text file ExtractTrait.php Class Class source
  Plain text file ManipulationTraits.php Class Class source
  Plain text file ParsingTrait.php Class Class source
  Plain text file ReplaceTrait.php Class Class source

  Files folder image Files  /  src  /  Models  
File Role Description
  Plain text file User.php Class Class source

  Files folder image Files  /  src  /  views  
File Role Description
  Accessible without login Plain text file login.php Aux. Auxiliary script
  Accessible without login Plain text file register.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:35
This week:0
All time:10,898
This week:73Up