how to access parameters from url in cakephp 3
<p>In cook book of cakephp 3. It is given to build url using</p>

<pre><code>echo $this-&gt;Url-&gt;build([
    "controller" =&gt; "Posts",
    "action" =&gt; "view",
    "foo" =&gt; "bar"
]);
</code></pre>

<p>which will output as</p>

<pre><code>/posts/view/foo:bar
</code></pre>

<p>How to access the <code>foo:bar</code> in action and save in a variable <code>$foo</code> ?</p>