PHP code example of hetao29 / slightphp

1. Go to this page and download the library: Download hetao29/slightphp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hetao29 / slightphp example snippets



//加载方式1,直接加载框架
//

 
class zone_page{ 
    function PageEntry($inPath){
        echo "Hello, world!";
    } 
} 


SlightPHP::setDefaultZone("user");
SlightPHP::setDefaultPage("profile");
SlightPHP::setDefaultEntry("update");

SlightPHP::setZoneAlias("user","u");
SlightPHP::setPageAlias("profile","p");

SlightPHP::setSplitFlag(".")

SlightPHP::setSplitFlag("-.")

SlightPHP::setSplitFlag(".");

RewriteRule   ^(/profile/.*)$ /index.php/user/profile/update/$1 [E=PATH_INFO:$1,L]

SlightPHP::setAppDir("/home/www/myAppdir");


root /var/www/slightphp/samples/www;
location / {
	try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
	fastcgi_pass   127.0.0.1:9000;
	fastcgi_index  index.php;
	fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;