Phrase Variables

silence

Well-known member
Okay so I'm calling a reponseError with the following line in my ControllerPublic:
Code:
            // Check time interval for commenting
            if ($commentPeriod = $model->commentFloodCheck() > 0)
            {
                return $this->responseError(new XenForo_Phrase('comment_interval_check'), 200, array('seconds' => $commentPeriod));
            }
With the phrase as the following:
Code:
You are commenting too fast! Please wait {seconds} second(s).
However, when the responseError displays, it shows up as:
Code:
You are commenting too fast! Please wait {seconds} second(s).
Why isn't the {seconds} variable being changed?

Thanks!
 
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check'), 200, array('seconds' => $commentPeriod));
Should be ;)
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check', array('seconds' => $commentPeriod)), 200);
 
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check'), 200, array('seconds' => $commentPeriod));
Should be ;)
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check', array('seconds' => $commentPeriod)), 200);
.... Thank you <3 I feel so silly.
 
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check'), 200, array('seconds' => $commentPeriod));
Should be ;)
Code:
return $this->responseError(new XenForo_Phrase('comment_interval_check', array('seconds' => $commentPeriod)), 200);
Spoke too soon, that doesn't seem to work:
Code:
Argument 3 passed to XenForo_Controller::responseError() must be of the type array, integer given, called in /home/fdsafdsa/public_html/xenforo/library/PostComments/ControllerPublic/Post.php on line 46 and defined
 
Spoke too soon, that doesn't seem to work:
Code:
Argument 3 passed to XenForo_Controller::responseError() must be of the type array, integer given, called in /home/fdsafdsa/public_html/xenforo/library/PostComments/ControllerPublic/Post.php on line 46 and defined
Make sure you using I code given. :)
 
Back
Top Bottom