GithubHelp home page GithubHelp logo

aeimi / ajxon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rohit-chouhan/ajxon

0.0 0.0 0.0 55 KB

PHP Framework to Generate Dynamic Work Ajax Code and UI

Home Page: https://github.com/rohit-chouhan/ajxon#readme

License: MIT License

PHP 100.00%

ajxon's Introduction

Ajxon 2.0

A JSON to Ajax UI Generator for Dynamic Work, with PHP, Ajxon system gives Ajax, PHP, HTML Form Code from JSON Structure. You can produce a total Dynamic Ajax stage from JSON.

Quick Installation

Download the master zip and paste the Ajxon Folder to your PHP Root Folder, and Enjoy it.

Installation with NPM

$ npm install rohit-chouhan/ajxon

Available on npmjs.com also

Go to https://www.npmjs.com/package/ajxon

$ npm i @rohit-chouhan/ajxon

Ajxon Objects

Objects Use
url PHP back-end page name, where database queries will generate
form HTML form name
table Database's Table name where Data will be stored/insert
type Ajax Data return type
include Name of folder, where url will be saved (ex. foldername/save.php), if you leave it blank. it will store in root folder
input field HTML form's Input name & Database Field Name (You can add multiple Object for Input)
Ex. "db_field_name" : "input_name : input_type : true"
True -> Input Field Required
False -> Optional
db Database connectivity information, you have to provide database HOST, USERNAME, PASSWORD, and DATABASE name

For Select & Radio Field Use :-

1. Select Field
gender:select:true:[value:label],[value|label]
2. Radio Button
gender:radio:true:[value:label],[value|label]
Example
gender:radio:true:[male:I am Male],[female|I am Female]

Sample Json Code

Here the sample JSON objects to you can access and provides identifiers.

{
    "url": "save.php",
    "form": "first_form",
    "table": "users",
    "type": "text",
    "include":"contents",
    "field": {
        "name": "name:text:false",
        "email": "email:email:true",
        "password":"pass:password:true"
    },
    "db": {
        "host": "localhost",
        "username": "root",
        "password": "Codesler@321",
        "database": "codesler"
    }
}

Future Code

Automatically generated code after using Ajxon

Code Output
HTML HTML CODE
JS/Ajax JS CODE
PHP PHP

Documention

Download Ajxon and Copy Ajxon.php to your root folder in project. create new page or include Ajxon.php require "Ajxon.php"; in exist page. create obj of new Ajxon() and have fun!

Function Use
$obj->set() the function can send JSON to Ajxon Class.
$obj->html() return the all HTML Form & Input to Page
$obj->js() return the Js/Ajax Code to Page
$obj->php() this function not return any code, the function can only generate code and save automatically to given "include" (folder) by user in JSON
$obj->inputclass() apply class to input field ex. $obj->inputclass('form-control')
$obj->inputstyle() apply css to input field ex. $obj->inputstyle('color:blue;')
$obj->btnclass() apply class to button ex. $obj->btnclass('btn-primary')
$obj->btnstyle() apply css to button ex. $obj->btnclass('background:blue;')
$obj->btnname() change name of button ex. $obj->btnname('Apply Form')
$obj->bootstrap() auto beautify the HTML form ex. $obj->bootstrap()

Example Complete Code

Here the complete sample code of PHP.

<?php
    require 'Ajxon.php'; //including Ajxon
    $obj=new Ajxon(); //Creating Ajxon object
    $x='{
    "url": "data.php",
    "form": "adds",
    "table": "users",
    "type": "text",
    "include":"contents",
    "field": {
        "name": "nameinput:text:false",
        "email": "emailinput:email:true",
        "password":"passinput:password:true"
    },
    "db": {
        "host": "localhost",
        "username": "root",
        "password": "",
        "database": "xxxx"
    }
}'; //Json Code

$obj->set($x); //Send JSON Code to Ajxon

$obj->php(); //Save (Database's) php file in Back-end

?>
<!DOCTYPE html>
<html>
<head>
    <title>Sample Ajxon</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
    <?php $obj->html();?>
    <!-- Getting HTML Input/Button -->
</body>
    <?php $obj->js();?>
    <!-- Getting JS/Ajax Code -->
</html>

Ajxon Structure

ajxon/
├── cons/
│   |── Bootstrap.php
│   ├── Input.php
│   └── Err/
│        └── Invalid.php  
└── Ajxon.php

License

MIT License

Developers

This framework is developed by Rohit Chouhan, Rohit Chouhan is the co-founder and CEO of Codesler, a company that's offering digital marketing services and an accomplished web developer.

ajxon's People

Contributors

rohit-chouhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.