B. Getting Started
3. Using Genes.API
For the API Framework:
You can just call it from the CDN.
Or you can just download, upload and run on any PHP environment,
local or cloud, much lower resource requirements than Wordpress, or similar.
API framework
This actually is the only line you need to get the Genes API running.
For the free version, it is a single PHP file, can be downloaded and unzipped from here:
GZ: https://cdn.genes.one/genes.php.gz
ZIP: https://cdn.genes.one/genes.php.zip
After you download and include "genes.php" in our PHP file, you just start using it.
The setup is done by itself, necessary folders and files (config etc.) are generated.
Below you can see a sample PHP file:
(an all-purpose starter sample is being prepared)
<?php
// JUST FIX THE PATH (COULD BE RELATIVE OR NOT, AS YOU PLEASE)
// SO THAT THE CLONE INDEX FINDS THE GENES FRAMEWORK, THAT'S IT.
require "../../_genes/api/genes.php";
// Index view is the main necessary view of the clone.
// You have more views, create more. You don't need more views.
// You can create all functionality in the same function.
// No one cares.
// MORE ABOUT HOW THIS WORKS WILL BE PUBLISHED ON THE API DOCS.
g::def("clone", array(
"Index" => function () {
g::run("ui.LoadViewHtml");
},
));
// Till now Genes got your config, your customizations,
// figured out the environment, figured out the mods,
// figured out the views, urls, the functions to be triggered,
// so now it renders.
g::run("core.Render");
// Done.
// A clean setup. :)
// A Genes Clone.