Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Description


string _p(string $phrase [, array $replacements] )


 Wrap your phrase or var_name in the _p() function. The phrase/var_name have to define at phrase.json

How to define?

To know how to define a phrase, please check here: Phrase System


Parameters


$phrase

English phrase or Var name

$replacements

Pass an associative array to add dynamic phrases. 

Examples


_p example
/**
 * Prints the phrase "Hello World!" and tries to find
 * a translation in the database if it exists.
 */
echo _p('Hello World!');


/**
 * Pass an associative array to add dynamic phrases.
 */
echo _p('My name is {name}', ['name' => 'Bob']);
  • No labels