提交的内容
This commit is contained in:
0
vendor/topthink/think-template/.gitignore
vendored
Executable file → Normal file
0
vendor/topthink/think-template/.gitignore
vendored
Executable file → Normal file
0
vendor/topthink/think-template/LICENSE
vendored
Executable file → Normal file
0
vendor/topthink/think-template/LICENSE
vendored
Executable file → Normal file
2
vendor/topthink/think-template/README.md
vendored
Executable file → Normal file
2
vendor/topthink/think-template/README.md
vendored
Executable file → Normal file
@ -67,4 +67,4 @@ Template::fetch('index',['name' => 'think']);
|
||||
Template::display($content,['name' => 'think']);
|
||||
~~~
|
||||
|
||||
详细用法参考[开发手册](https://www.kancloud.cn/manual/think-template/content)
|
||||
详细用法参考[开发手册](https://doc.thinkphp.cn/@think-template)
|
||||
0
vendor/topthink/think-template/composer.json
vendored
Executable file → Normal file
0
vendor/topthink/think-template/composer.json
vendored
Executable file → Normal file
0
vendor/topthink/think-template/phpunit.xml
vendored
Executable file → Normal file
0
vendor/topthink/think-template/phpunit.xml
vendored
Executable file → Normal file
15
vendor/topthink/think-template/src/Template.php
vendored
Executable file → Normal file
15
vendor/topthink/think-template/src/Template.php
vendored
Executable file → Normal file
@ -207,7 +207,7 @@ class Template
|
||||
* @param callable|null $callback 解析规则回调
|
||||
* @return void
|
||||
*/
|
||||
public function extend(string $rule, callable $callback = null): void
|
||||
public function extend(string $rule, ?callable $callback = null): void
|
||||
{
|
||||
$this->extend[$rule] = $callback;
|
||||
}
|
||||
@ -808,7 +808,7 @@ class Template
|
||||
* @param string|null $name 不为空时返回指定的属性名
|
||||
* @return array
|
||||
*/
|
||||
public function parseAttr(string $str, string $name = null): array
|
||||
public function parseAttr(string $str, ?string $name = null): array
|
||||
{
|
||||
$regex = '/\s+(?>(?P<name>[\w-]+)\s*)=(?>\s*)([\"\'])(?P<value>(?:(?!\\2).)*)\\2/is';
|
||||
$array = [];
|
||||
@ -1068,6 +1068,9 @@ class Template
|
||||
switch (strtolower($fun)) {
|
||||
case 'raw':
|
||||
break;
|
||||
case 'htmlentities':
|
||||
$name = 'htmlentities((string) ' . $name . ')';
|
||||
break;
|
||||
case 'date':
|
||||
$name = 'date(' . $args[1] . ',!is_numeric(' . $name . ')? strtotime(' . $name . ') : ' . $name . ')';
|
||||
break;
|
||||
@ -1189,15 +1192,15 @@ class Template
|
||||
$parseStr = '';
|
||||
|
||||
foreach ($array as $templateName) {
|
||||
if (empty($templateName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (str_starts_with($templateName, '$')) {
|
||||
//支持加载变量文件名
|
||||
$templateName = $this->get(substr($templateName, 1));
|
||||
}
|
||||
|
||||
if (empty($templateName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$template = $this->parseTemplateFile($templateName);
|
||||
|
||||
if ($template) {
|
||||
|
||||
0
vendor/topthink/think-template/src/facade/Template.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/facade/Template.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/TagLib.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/TagLib.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/contract/DriverInterface.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/contract/DriverInterface.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/driver/File.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/driver/File.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/exception/TemplateNotFoundException.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/exception/TemplateNotFoundException.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/taglib/Cx.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/src/template/taglib/Cx.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/bootstrap.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/bootstrap.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/tag/Demo.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/tag/Demo.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/extend.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/extend.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/fetch.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/fetch.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/include.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/include.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/layout.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/template/layout.html
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/think/TemplateTest.php
vendored
Executable file → Normal file
0
vendor/topthink/think-template/tests/think/TemplateTest.php
vendored
Executable file → Normal file
Reference in New Issue
Block a user