Skip to content
/ simgo Public

Micro-Framework. This is a simple and attractive library will help you to write php code more clear and easy!

Notifications You must be signed in to change notification settings

jofpin/simgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

simgo

Micro-Framework. This is a simple and attractive library will help you to write php code more clear and easy!

The library is fully documented, and is easy to understand, I'm looking for improving and facilitating the writing of php. Have to play with the programming languages ​​they are old and everything is part of history!

First, you have to include the library in your project. to use it!

<?php
include "simgo.php"; // simgo on!
?>

go();

// Example: "echo" It serves to print, but many people criticize it. here use go(""); printable!
$test = "Blue chickens";
go($test);
// simple text
go("Hi I'm chicken"); 

page("");

// Example: To replace the ugly "include or require"
page("header.php");
page("connection.php", 2);
page("logic/math.php");
page("view/footer.php", 3);

clean();

// Example: This is the replacement of htmlentities but more strong against the Cross-site scripting (XSS)!
$xss = clean("<script>alert(1337);</script>");
go($xss); 
// or but it is better to use goClean(); When not using variables. This print direct!
goClean("<script>alert(1337);</script>");  /* = */ go(clean("<script>alert(1337);</script>"));

filter();

// Example: Single xss and special here in simgo cleaning filter! 
$xss = filter("<script>alert("xss");</script>");
go($xss); 
// A good cleaning 
goFilter("<script>alert("xss");</script>");  /* = */ go(filter("<script>alert("xss");</script>"));

get(); & post("");

// Example: It's boring to always write $_GET["chicken"]; or $_POST["chicken"]; This is already in the past. now is get("chicken"); and post("chicken");
$request = get("chicken");
go($request);
// a little sexy!
goGet("chicken");  /* GET printing /* = */ go(get("chicken"));
goPost("chicken"); /* POST printing /* = */ go(post("chicken"));

email();

// Example: Protection of email to prevent spam-bots and sniff. ;)
$mail = email("chicken@example.com");
go($mail);
// When print direct!
goEmail("chicken@example.com"); /* = */ go(email("chicken@example.com"));

fus();

// Example: Prevent sniffing of text, and also obfuscate! 3:
$text = fus("Insert text to protect");
go($text);
// When print direct!
goFus("Insert text to protect"); /* = */ go(fus("Insert text to protect"));

goHeader(); & redirect();

// Example: Customization and replacement of header() by goHeader() 
goHeader("X-Frame-Options: DENY"); /* or */ goHeader("Location: http://example.com");

// with redirect(); everything changes
// Redirection to URL or directory
redirect("http://example.com"); /* directory */  redirect("test");

ajax();

// Example: Support for AJAX requests php!
// used in this way, is more simple.
if (ajax()) {
    // your code here! :*
}

baseUrl(); & currentUrl();

// Example: Management of "base url" and "current url"
baseUrl();
currentUrl();
// and ready!
  • These two functions are information and documentation!

author(); & version();

// author(); and goAuthor(); = Jose Pino
// version(); and goVersion(); = the version most recent simgo!

This is a drop of water, to facilitate the writing a bit of code and be happy! :D

Happy code!


Copyright, 2014 by Jose Pino


About

Micro-Framework. This is a simple and attractive library will help you to write php code more clear and easy!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages