PHP code example of keenlysoft / keenly
1. Go to this page and download the library: Download keenlysoft/keenly 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/ */
keenlysoft / keenly example snippets
use keenly\routes\routes;
routes::get('', 'index@index');
routes::get('home2/i/w', 'admin@index@home2');
routes::post('contact', 'index@contact');
routes::get('(:all)', false);
routes::keenly();
'redis' => [
'driver' => 'pconnect', // or connect
'host' => '127.0.0.1',
'port' => '6379',
'password' => '',
'selectDB' => '0',
'timeout' => '1',
'rebinding' => '100',
],
keenly::$box->redis->set();
redis::I()->use('0')->set();
$user = User::find()->where('id > 0');
$pag = new pagination($user->Count(), $page, 2);
$list = $user->limit($pag->limit)->offset($pag->offset)->all();
k::render('test', [
'list' => $list,
'page' => $pag->page(),
]);
nginx
server {
listen 80;
server_name keenly.example;
root /path/to/keenly/web;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_pass unix:/path/to/php-fpm.sock;
fastcgi_index index.php;
bash
php keenly model
php keenly model user
php keenly model -f user