定制 drago-ex/parameters 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

drago-ex/parameters

最新稳定版本:v1.0.7

Composer 安装命令:

composer require drago-ex/parameters

包简介

A simple Nette extension for accessing common directory paths (appDir, wwwDir, tempDir) in your application via dependency injection.

README 文档

README

A lightweight extension for managing application directory paths (such as application, public, and temporary directories) within a Nette-based project. Provides a simple way to access these paths via dependency injection.

License: MIT PHP version Tests Coding Style

Requirements

  • PHP >= 8.3
  • Nette Framework
  • Composer

Installation

composer require drago-ex/parameters

Extension Registration

To enable the Parameters extension in your Nette project, add the following configuration to your neon file. This registers the ParametersExtension and injects paths to the application, public, and temporary directories.

extensions:
	- Drago\Parameters\DI\ParametersExtension(appDir: %appDir%, wwwDir: %wwwDir%, tempDir: %tempDir%)

This will automatically inject the directory paths as services into your project.

Accessing Directories in Your Application

Once registered, you can access the directory paths throughout your application using the following properties:

Application Directory

To get the path to your application's directory (usually the root directory of your app), use:

$this->appDir;

Public Directory

To get the path to your public directory (e.g., the www or public directory):

$this->wwwDir;

Temporary Directory

To get the path to the temporary directory (where cache or logs might be stored):

$this->tempDir;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-06