百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

LadybugBundle

> 编程语言
开源

Ladybug 库的 Symfony2 组件,即简单而可扩展的 PHP Dump 程序

325 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Ladybug 库的 Symfony2 组件,即简单而可扩展的 PHP Dump 程序

LadybugBundle

This bundle provides an easy and extensible var_dump/print_r replacement for Symfony2 projects, both in controllers or Twig templates. For example, with this bundle, the following is possible:

php
getRequest())

The same can be accomplished using the Twig filter ladybug_dump.

Helpers

The are 5 helpers that can be used in any controller:

ladybug_dump($var1[, $var2[, ...]]): Dumps one or more variables

ladybug_dump_die($var1[, $var2[, ...]]): Dumps one or more variables and terminates the current script

ladybug_dump_return($format, $var1[, $var2[, ...]]): Dumps one or more variables and returns the dump in any of the following formats:

  • yml: Returns the dump in YAML
  • json: Returns the dump in JSON
  • xml: Returns the dump in XML
  • php: Returns the dump in PHP arrays

ladybug_dump_ini([$extension]): Dumps all configuration options

ladybug_dump_ext(): Dumps loaded extensions

There are also some shortcuts in case you are not using this function names:

ld($var1[, $var2[, ...]]): shortcut for ladybug_dump

ldd($var1[, $var2[, ...]]): shortcut for ladybug_dump_die

ldr($format, $var1[, $var2[, ...]]): shortcut for ladybug_return

Only ladybug_dump can be used inside Twig templates.

Symfony profiler integration

Instead of printing out the dump tree inside the HTML document, you can use the Ladybug logger and see the results in a tab of the Symfony profiler:

To make use of the Ladybug logger, grab the ladybug service from the DIC, and call the log method:

php
get('ladybug')->log($var);
    }

API reference

Ladybug automatically detects Symfony, Doctrine, Twig, Silex and other classes, and link them to the official documentation.

Configuration

You can configure ladybug library directly in your config.yml file. Here are the defaults:

yaml
raul_fraile_ladybug:
    theme: modern # select the theme: base, modern or custom themes
    expanded: false # true to expand all the variables tree by default
    silenced: false # true to ignore all ladybug calls

Credits

  • Raul Fraile (@raulfraile)
  • All contributors

License

LadybugBundle is released under the MIT License. See the bundled LICENSE file for details.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言