PHP code example of wllionel / framework
1. Go to this page and download the library: Download wllionel/framework 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/ */
wllionel / framework example snippets
127.0.0.1 testtiah.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ /public/$1 [L]
RewriteCond %{REQUEST_URI} !(.css|.js|.png|.jpg|.gif|robots.txt|.ttf)$ [NC]
</IfModule>
<VirtualHost testtiah.com:80>
DocumentRoot "C:\xampp\htdocs\marinesTeam26"
ServerName testtiah.com
ServerAlias *.testtiah.com
</VirtualHost>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_URI} !(.css|.js|.png|.jpg|.gif|robots.txt|.ttf)$ [NC]
</IfModule>
<VirtualHost *:80>
RewriteEngine on
ServerName localhost
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
</VirtualHost>
<VirtualHost localhost:443>
DocumentRoot "C:\xampp8\htdocs"
ServerName localhost
ServerAlias *.localhost
<Directory "C:\xampp8\htdocs">
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "conf/localhost/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/localhost/ssl.key/server.key"
</VirtualHost>
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^admin/(.*)?$ /backend/web/$1 [L,PT]
RewriteRule ^([^/].*)?$ /frontend/web/$1
RewriteRule ^index\.php$ - [L]
</IfModule>
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
'components' => [
'request' => [
'csrfParam' => '_csrf-frontend',
'baseUrl' => '',
'enableCookieValidation' => true,
'enableCsrfValidation' => true,
'cookieValidationKey' => '45ed697dtg8uhrg9eheg00j09',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
'<_c:[\w\-]+>' => '<_c>/index',
'<_c:[\w\-]+>/<_a:[\w\-]+>/<id:\d+>' => '<_c>/<_a>',
]
]
]
'components' => [
'request' => [
'csrfParam' => '_csrf-backend',
'baseUrl' => '/admin',
'enableCookieValidation' => true,
'enableCsrfValidation' => true,
'cookieValidationKey' => '45ed697dtg8uhrg9eheg00j09',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'<_c:[\w\-]+>/<id:\d+>' => '<_c>/view',
'<_c:[\w\-]+>' => '<_c>/index',
'<_c:[\w\-]+>/<_a:[\w\-]+>/<id:\d+>' => '<_c>/<_a>',
]
]
]