title: Yii2 - How to modify controller action param using a behavior?
body: <p>I'm trying to change the <code>$id</code> param in my controller methods on the fly using <code>beforeAction</code> and a <code>behavior</code>.  FYI, I'm going to use HashIds and need to convert anywhere I have a <code>$_GET['id']</code> that may be hashed back into an integer. </p>
  
  <p>How can I use a behavior to automatically modify my $_GET['id'] on the fly using a <strong>behavior</strong>? </p>
  
  <p>An example action in my controller:</p>
  
  <pre><code>public function actionView($id){
      // run code to process $id here back to integer using a behavior
      echo $id; //should be an integer
  }
  </code></pre>
  
  <p>My sample url: <code>http://mydomain/posts/view?id=3QhLp</code></p>
  
  <p>(Alternatively, perhaps the better way to do this is to create a custom url rule?)</p>