Pyro
  • Product
    • Features
    • Platform
  • Pro
  • Developers
    • Documentation
    • Guides
    • Videos
    • GitHub
  • Community
    • Blog
    • Forum
    • Discord
    • Twitter
    • Facebook
  • Login

Parser

  1. Documentation
  2. Application
  3. Streams Platform
  4. Parser
X
  • Product
  • Features
  • Platform
  • Pyro PRO
  • Developers
  • Documentation
  • Guides
  • Videos
  • GitHub
  • Community
  • Blog
  • Forum
  • Discord
  • Twitter
  • Facebook
  • Login
  • Getting Started
    • Introduction
    • Installation
  • The Basics
    • Streams Plugin
    • Presenters
    • Routing
    • Views
    • Service Container
    • Service Providers
    • HTTP Cache
  • Services
    • Asset
    • Authorization
    • Artisan
    • Callbacks
    • Collections
    • Config
    • Currency
    • Evaluator
    • Filesystem
    • Hooks
    • Image
    • Localization
    • Messages
    • Parser
    • Resolver
    • String
    • Valuation
  • UI
    • Breadcrumbs
    • Buttons
    • Control Panel
    • Forms
    • Icons
    • Tables
  • Database
    • Migrations
    • Query Builders
  • Models
    • Relationships
    • Entry Routers
    • Versioning
  • Plugin
    • Addon
    • Agent
    • Asset
    • Auth
    • Breadcrumb
    • Favicons
    • Carbon
    • Config
    • CSRF
    • Entries
    • Env
    • Footprint
    • Image
    • Request
    • Route
    • Session
    • String
    • Translator
    • URL
    • View
  • Addons
    • The Basics
    • Field Types
Edit this Page
  • 1.7
  • 1.6
  • 1.5
  • 1.4
  • 1.3

Parser

The Parser class is a simple service that parses data into a string. The parser leverages the (https://packagist.org/packages/nicmart/string-template) package.

Basic Usage

Include the Anomaly\Streams\Platform\Support\Parser class in your code to get started.

Parser::parse()

The parse method recursively parses the value with given data.

Returns: string
Arguments
Key Required Type Default Description

$target

true

mixed

none

The string or array of strings.

$data

false

array

none

An array of data to parse into the $target.

Example
$parser->parse('Hello {user.first_name} {user.last_name}!', ['user' => Auth::user()]);
  1. Parser

©2025 PyroCMS, Inc.
All rights reserved.