承接 fastpress/view 相关项目开发

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

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

fastpress/view

最新稳定版本:0.1.3

Composer 安装命令:

composer require fastpress/view

包简介

A flexible and intuitive templating engine for PHP, optimized for use with the Fastpress framework. Provides an easy-to-use interface for rendering views, handling layouts, and managing content blocks.

README 文档

README

Fastpress View is a powerful and flexible templating engine for PHP, designed to render views and manage layouts seamlessly within the Fastpress framework.

Installation

Use Composer to install Fastpress View into your project:

composer require fastpress/view

Methods

render(string $view, array $data = []): self

Renders a view with the given data.

Parameters:

  • $view: The name of the view file.
  • $data: An array of data to pass to the view.

Returns:

  • The View instance.

extend(string $layout): self

Extends a layout.

Parameters:

  • $layout: The name of the layout file.

Returns:

  • The View instance.

block(string $name): self

Starts a template block.

Parameters:

  • $name: The name of the block.

Returns:

  • The View instance.

endBlock(string $name = null): void

Ends a template block.

Parameters:

  • $name: The name of the block (optional).

Returns:

  • void

content(string $name): void

Outputs the content of a template block.

Parameters:

  • $name: The name of the block.

Returns:

  • void

share(string $key, mixed $value): self

Shares data across all views.

Parameters:

  • $key: The key for the shared data.
  • $value: The value of the shared data.

Returns:

  • The View instance.

e(mixed $value): string

Escapes HTML special characters in a string.

Parameters:

  • $value: The value to escape.

Returns:

  • The escaped string.

set(string $key, mixed $value = null): void

Sets an application configuration value.

Parameters:

  • $key: The configuration key.
  • $value: The configuration value.

Returns:

  • void

get(string $key): mixed

Gets an application configuration value.

Parameters:

  • $key: The configuration key.

Returns:

  • The configuration value.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-13