akalod / zehir
该包最新版本(dev-main)没有可用的许可证信息。
Zehir NewGen MVC Core
dev-main
2022-06-08 22:30 UTC
Requires
- php: >=5.5.9
- illuminate/database: 5.2
- monolog/monolog: ^1
- nesbot/carbon: 1.39.0
- php-amqplib/php-amqplib: ^2.9
- phpmailer/phpmailer: ^6
- predis/predis: ^1
- symfony/console: 3.4.32
- symfony/yaml: ^3.4
- twig/twig: ^1
This package is not auto-updated.
Last update: 2024-09-26 08:56:18 UTC
README
example index.php(或其他人)
use Zehir\Settings\Setup as setup; use Zehir\System\App; include "vendor/autoload.php"; /** 'url-path'=>'MVC/bundle-path' **/ setup::$bundles=[ 'api'=>'API', 'stok'=>'STOK', 'zehir'=>'PANEL' ]; setup::$target = 'dev'; //for select target database configuration setup::$webUrl = 'https:///'; App::run();
webconfig 规则
<rule name="ZehirMVC" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> <add input="{URL}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="_app.php/{R:1}" /> </rule>
.htaccess 规则
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{URL} !-d
RewriteRule ^(.*)$ {{filaname}}.php/$1 [L]
</IfModule>
你可以使用 "no-database"
Setup::$noSQL = true;
你可以禁用数据库路由
Setup::$routeDB = false;
数据库设置
Setup::configure([ 'local' => Array( 'host' => 'localhost', 'name' => 'databasename', 'user' => 'username', 'pass' => 'sifre', 'port' => 3306, 'adapter' => 'mysql', 'redis_server' => 'localhost', 'redis_port' => 6379, ), 'test' => Array( 'host' => '91.121.***.***', 'name' => 'dp_tests', 'user' => 'dp_tests', 'pass' => '*****', 'port' => 3306, 'adapter' => 'mysql' )]);
启用多语言
Setup::$multiLang = true; Setup::$enableLanguages[] = ['id' => 1, 'lang' => 'TR']; Setup::$enableLanguages[] = ['id' => 2, 'lang' => 'EN'];
安装预置模块
Setup::$installParameters = ['news', 'banners', 'pages']; // if you need install modules send to 'install' param to App::run // App::run('install');
注入 Twig 过滤器
Setup::$TwigFilters = [ [ "name" => 'tracker', 'fn' => function ($string) { return $string . '?' . $_SERVER["QUERY_STRING"]; } ] ];
通过 SEO 列表搜索数据库路由名称
Setup::$search_extend['dabase_table_name'] = 'controller_name';
添加自定义值
Setup::addCustom('JWT_SECRET', 'T3-5T~=!@\'/W3Eh:[Gb4@~{}_v{?e8}%7HDp');
获取自定义值
Setup::custom('JWT_SECRET')
将值分配给模板引擎
App::assign('pageTitle',$data->name);