承接 bndrmrtn/flamephp_engine 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bndrmrtn/flamephp_engine

Composer 安装命令:

composer require bndrmrtn/flamephp_engine

包简介

Drop the old PHP <?= syntax and never use it again, the solution is *.flame.php wich converts {{ $title }} to <?php echo $title ?> and @foreach(...) ... @endforeach to <?php foreach(...): ?> ... <?php endforeach ?>, so UI development is not a PAIN anymore with flamephp_engine

README 文档

README

How to add to a project?

Install it via composer and add it to your file.

composer require bndrmrtn/flamephp_engine:dev-main
require_once 'vendor/autoload.php';

Configure or use the default config

use Bndrmrtn\FlamephpEngine\FlamePHP;
use Bndrmrtn\FlamephpEngine\FlamePHP\Config;

$flame = new FlamePHP(
     viewsDirectory: '...', // The directory where you store your views
     useDevelopmentMode: true, // Your project is in development mode or not
     cacheDirectory: '...',  // The directory where you want to store your cache data
     config: new Config, // Custom config, or use the default
);

How to use it?

You can use it with *.flame.php files with a directory named views in your root folder, or the parseString option that doesn't requires any file. (Except the cache files that auto generated by this tool).

Code examples

With the textParser option

use Bndrmrtn\FlamephpEngine\FlamePHP;

$flame = new FlamePHP;

$flame->parseString('
     <h1>Hello {{ $world }}</h1>
', ['world' => 'Developer'],
);

// <h1>Hello Developer</h1>

With the file option

// ...
$flame->includeFile(
     'filename', // without the .flame.php extension!
     ['name' => 'John'] // add props to it
);

Actually you can get the path of the file's cache with the parseFile method, like this:

// ...

$parsed_file = $flame->parseFile(
     'filename', // without the .flame.php extension!
     // No props here
);

echo $parsed_file; // output: C:\...\your_project\flamephp_engine\cache\views\filename.flame.php

Demo

You can check the /tests folder and run the tests with PHPUnit

Documentation

Here FlameCore Official Views Documentation you can find a small documentation of how it works, but I must remind you that it documents a modified version and that you should follow the default settings as described above!

Credits

Martin Binder, FullStack Web Developer, 4 years of experience with PHP, 3 with Laravel. Currently I am learning GoLang ;)

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-11-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固