-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Ray Package for Neos CMS | ||
# Ray Helper for Neos CMS | ||
|
||
Debug your Neos site with the Ray app. | ||
Ray is a debugger app from Spatie. You can find more information about Ray on https://myray.app/. | ||
|
@@ -13,25 +13,54 @@ Then run `composer update` in your project root. | |
|
||
## Requirements | ||
You need to have the Ray app installed and a valid license. | ||
You can download the app here: https://myray.app. | ||
You can download the app here: https://spatie.be/docs/ray/v1/the-ray-desktop-app/download-the-free-demo. | ||
|
||
## Configuration | ||
Create the configuration file `ray.php` in your Neos site root directory. | ||
Configuration options: https://spatie.be/docs/ray/v1/configuration/framework-agnostic-php. | ||
Configuration options when you use Docker: https://spatie.be/docs/ray/v1/environment-specific-configuration/docker. | ||
|
||
## Usage | ||
You can use all Ray functions from https://spatie.be/docs/ray/v1/usage/framework-agnostic-php-project. | ||
Reference list (just the PHP specific functions): https://spatie.be/docs/ray/v1/usage/reference. | ||
|
||
To use the functions, you must add them as key-value pairs in Fusion. | ||
If the function does not require any parameters, you can use `null`, `false` or an empty string as the value. | ||
To pass parameters, add them as a value. | ||
|
||
```html | ||
valueToDebug = 'Show this text in the Ray app.' | ||
[email protected] = Beromir.Ray:Debug { | ||
// Show a label in the Ray app | ||
label = 'Text' | ||
// Colorize the output | ||
red = '' | ||
// Show the output as large text | ||
large = '' | ||
} | ||
``` | ||
|
||
```html | ||
valueToDebug = 'Show this text in the Ray app.' | ||
[email protected] = Beromir.Ray:Debug { | ||
// Show a label in the Ray app | ||
label = 'Text' | ||
// Only send a payload once when in a loop | ||
once = ${node} | ||
} | ||
``` | ||
|
||
**Debug a Fusion expression:** | ||
```html | ||
valueToDebug = 'Show this text in the Ray app.' | ||
[email protected] = Beromir.Ray:Ray | ||
[email protected] = Beromir.Ray:Debug | ||
``` | ||
|
||
Alternative ways: | ||
```html | ||
// Debug the current node | ||
debug = Beromir.Ray:Ray { | ||
debugValues = ${node} | ||
debug = Beromir.Ray:Debug { | ||
value = ${node} | ||
} | ||
|
||
renderer = afx` | ||
|
@@ -41,27 +70,27 @@ renderer = afx` | |
|
||
```html | ||
renderer = afx` | ||
<Beromir.Ray:Ray debugValues={node}/> | ||
<Beromir.Ray:Debug debugValues={node}/> | ||
` | ||
``` | ||
|
||
**Debug multiple values:** | ||
```html | ||
debug = Beromir.Ray:Ray { | ||
debug = Beromir.Ray:Debug { | ||
// Pass the values as an array | ||
debugValues = ${[node, site]} | ||
value = ${[node, site]} | ||
} | ||
|
||
renderer = afx` | ||
{props.debug} | ||
` | ||
``` | ||
|
||
**Use Debug Actions:** | ||
**Use Debug Actions to debug NodeTypes:** | ||
```html | ||
// Display the NodeType name of the node | ||
debug = Beromir.Ray:Ray { | ||
debugValues = ${node} | ||
debug = Beromir.Ray:Debug { | ||
value = ${node} | ||
debugAction = 'nodeTypeName' | ||
} | ||
|
||
|
@@ -72,8 +101,8 @@ renderer = afx` | |
|
||
```html | ||
// Display the properties of the current node and the site node | ||
debug = Beromir.Ray:Ray { | ||
debugValues = ${[node, site]} | ||
debug = Beromir.Ray:Debug { | ||
value = ${[node, site]} | ||
debugAction = 'properties' | ||
} | ||
|
||
|
@@ -82,12 +111,10 @@ renderer = afx` | |
` | ||
``` | ||
|
||
You can use the following Debug Actions: | ||
You can use the following Debug Actions for NodeTypes: | ||
|
||
| Debug Action| Description | | ||
| --- | --- | | ||
| `phpInfo` | Display PHP info | | ||
| `backtrace` | Display entire backtrace | | ||
| `nodeTypeName` | Display the NodeType name of a node | | ||
| `context` | Display the context of a node | | ||
| `contextPath` | Display the context path of a node | | ||
|