From 9f8e56d68779bfa37cd2d87505a68faec0881cf9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 21 Jul 2011 08:18:49 -0700 Subject: [PATCH] Added ability to pass replacements in Lang constructor. --- system/lang.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system/lang.php b/system/lang.php index 1611bd56..07cce849 100644 --- a/system/lang.php +++ b/system/lang.php @@ -32,23 +32,26 @@ class Lang { * "messages.required" language line would return the "required" line * from the "messages" language file. * - * @param string $line + * @param string $key + * @param array $replacements * @return void */ - public function __construct($key) + public function __construct($key, $replacements = array()) { $this->key = $key; + $this->replacements = $replacements; } /** * Create a Lang instance for a language line. * * @param string $key + * @param array $replacements * @return Lang */ - public static function line($key) + public static function line($key, $replacements = array()) { - return new static($key); + return new static($key, $replacements); } /**