• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Phrase Variables

silence

Well-known member
#1
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!
 

truonglv

Formerly Nobita.Kun
#2
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);
 

silence

Well-known member
#3
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.
 

silence

Well-known member
#4
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
 

truonglv

Formerly Nobita.Kun
#5
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. :)