# Using Ray with Yii

[Yii](https://www.yiiframework.com/) is a high-performance PHP framework for developing modern web applications. Use Ray to help you debug when you're developing a Yii application, extension or module.

[spatie/yii-ray](https://github.com/spatie/yii-ray)

## [#](/content/docs/php/yii/getting-started#installing-the-package "Permalink"/index.html) Installing the package

```
composer require spatie/yii-ray
```

This installs Ray as a project dependency, meaning it will also be installed in your production environment. Your application won't break if you forget to remove a `ray` call. The package doesn't send data when the environment isn't set to `dev`.

If you prefer, install it as a dev dependency by adding `--dev` to the composer command. Note that with a dev dependency, any `ray` calls left in your code will cause errors in production, so you'll need to remove them before deploying. We have some options for [detecting Ray calls](/content/docs/php/vanilla-php/detecting-removing-ray-calls/index.html) in your app.

```
composer require spatie/yii-ray --dev
```

## [#](/content/docs/php/yii/getting-started#usage "Permalink"/index.html) Usage

All [generic PHP methods](/content/docs/php/vanilla-php/usage/index.html) are available when using Yii.

To enable `ray()`, `dd()` and `dump()` globally in any file, see the [global installation instructions](/content/docs/php/vanilla-php/installation#global-installation/index.html).

> ## [#](/content/docs/php/yii/getting-started#whats-next "Permalink"/index.html) What's next?
> 
> Now that Ray is installed in your Yii project, see what you can use it for.
> 
> - [Learn how to use Ray with PHP](/content/docs/php/vanilla-php/usage/index.html)
> - [View all available methods](/content/docs/php/vanilla-php/reference/index.html)

## Debug without breaking your flow

Ray keeps all your debug output neatly organized in a dedicated desktop app.

Download Ray

[Buy Ray for\
434 NOK](https://spatie.be/products/ray)

Licenses are valid for 1 year and managed through [Spatie](https://spatie.be/products/ray). Licenses purchased before Ray 3 remain valid. VAT is calculated at checkout.

### Thanks for trying out Ray!

macOS

[ARM](https://spatie.be/products/ray/v3/download/macos-arm64/latest) [Intel](https://spatie.be/products/ray/v3/download/macos-x64/latest)

Windows

[x86 (Intel)](https://spatie.be/products/ray/v3/download/windows/latest)

Linux

[AppImage](https://spatie.be/products/ray/v3/download/linux/latest)
