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

Phrase Variables

Discussion in 'XenForo Development Discussions' started by silence, Mar 3, 2014.

  1. silence

    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!
     
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    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 likes this.
  3. silence

    silence Well-Known Member

    .... Thank you <3 I feel so silly.
     
    Nobita.Kun likes this.
  4. silence

    silence Well-Known Member

    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
    
     
  5. Nobita.Kun

    Nobita.Kun Well-Known Member

    Make sure you using I code given. :)
     
    silence likes this.
  6. silence

    silence Well-Known Member

    Ugh you're a genius, I feel so dumb. Thanks again mate!
     
    Nobita.Kun likes this.

Share This Page