title: yii2 how can I access post value
body: <p>I have the following code in my controller trying to get it to work before adding validation etc</p>
  
  <p>This code is from <a href="https://stackoverflow.com/questions/21395410/mailchimp-api-2-0-and-php-subscribe-form">here</a> however I will be adapting it anyway </p>
  
  <pre><code>    $email = $_POST['Newsletter[email]'];
  
      $session-&gt;save_email($email);
      // Subscribe User to List
      $api_key = new sammaye\mailchimp\Mailchimp(['apikey' =&gt; 'xxxxxxxxxxx']);
      $list_id = "xxxxxxxxxxx";
  
      $Mailchimp = new Mailchimp( $api_key );
      $Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
      $subscriber = $Mailchimp_Lists-&gt;subscribe( $list_id, array( 'email' =&gt; $email ) );
  </code></pre>
  
  <p>However I get the following error (Does this mean my most data is in an array newbie)</p>
  
  <pre><code>Undefined index: Newsletter[email]
  </code></pre>
  
  <p>Is this something I need to set within my yii2 form so that instead of the name field being Newsletter[email] its just email?</p>