- 授权协议: MIT
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://gitee.com/wwsg18/lolly
- 软件文档: https://www.kancloud.cn/wwsg/lollyfw/698925
软件介绍
Lolly
项目介绍
一款轻量级的PHP框架,可快速开发中小型项目
功能介绍
内置模板引擎,支持部分语句(if for goto ...)
内置强大的Medoo框架,踩上了巨人的肩膀
内置Composer,快捷的依赖管理
轻量级高性能,节省更多的开销
代码演示
路由设置:
//设置单个路由
$lolly->route('/','index');
//设置多个路由
$lolly->routeList([
'/' => 'index',
'/user' => 'user'
]);
//直接读取route.php的配置文件
$lolly->routeConf();模板引擎:
//输出变量的值
{{$name}}
//if语句
{{if 1 + 1 == 2}}
//else语句
{{ else }}
//elseif语句
{{elif 1 + 1 == 3 }}
//for语句
{{ for $i = 1;i < 10;i++ }}
//循环遍历
{{ loop $name($k,$v) }}
//while
{{ while true }}
//结束语句(通用)
{{ end }}
......简单的Hello world
<?php
/*
* lolly入口文件
*
*/
use Lolly\Lolly;
define('Lolly',dirname(__FILE__) . '/');
//引用自动加载文件
require_once(Lolly . 'vendor/autoload.php');
$lolly = new Lolly();
$lolly->route('/hello','hello');
//index函数
function hello($arg){
arg可以获取二级Path
if(sizeof($arg) > 2){
return \Lytpl\Lytpl::render_err('404',[]);
}
return "hello:" . $arg[1];
}
//访问 /hello/name会输出一个 "hello:name" 如果访问的是 /hello/name/XXX 会出现404
$lolly->run();模板继承代码:
index.php
<?php
/*
* lolly入口文件
*
*/
use Lolly\Lolly;
define('Lolly',dirname(__FILE__) . '/');
//引用自动加载文件
require_once(Lolly . 'vendor/autoload.php');
$lolly = new Lolly();
$lolly->route('/hello','hello');
function hello(){
return \Lytpl\Lytpl::render_tpl('index.html',[])
}Lolly/view/public/index.html
{{GlobalFun::extend('head/head.html',['test' => 'test msg'])}}this is in Lolly/view/public/index.htmlLolly/view/public/head/head.html
{{$test}} this is in Lolly/view/public/head/head.htmlsiege测试
循环输出10个 hello world
MBP:~ mrxzx$ siege -c 100 -t 30s localhost/lolly
Transactions: 16352 hits
Availability: 99.79 %
Elapsed time: 29.78 secs
Data transferred: 3.53 MB
Response time: 0.11 secs
Transaction rate: 549.09 trans/sec
Throughput: 0.12 MB/sec
Concurrency: 60.91
Successful transactions: 16441
Failed transactions: 34
Longest transaction: 0.42
Shortest transaction: 0.01
Python神经网络编程
[英]塔里克·拉希德(Tariq Rashid) / 林赐 / 人民邮电出版社 / 2018-4 / 69.00元
神经网络是一种模拟人脑的神经网络,以期能够实现类人工智能的机器学习 技术。 本书揭示神经网络背后的概念,并介绍如何通过Python实现神经网络。全书 分为3章和两个附录。第1章介绍了神经网络中所用到的数学思想。第2章介绍使 用Python实现神经网络,识别手写数字,并测试神经网络的性能。第3章带领读 者进一步了解简单的神经网络,观察已受训练的神经网络内部,尝试进一步改......一起来看看 《Python神经网络编程》 这本书的介绍吧!
