Not getting default route parameter in ZF3
<p>In ZF3 I want to get default parameter from route. I'm getting parameters in this way in controller:</p>

<pre><code>$params = $this-&gt;params()-&gt;fromRoute('crud');
</code></pre>

<p>My urls looks like this:</p>

<pre><code>1: somedomain/admin/color/add
2: somedomain/admin/color
</code></pre>

<p>In 1) I'm getting <b><code>add</code></b> in my <code>$params</code> variable.<br>
In 2) I'm getting <b><code>null</code></b> but I'm expecting default (in this case <b><code>view</code></b>)</p>

<p>I think this is problem with bad router configuration.</p>

<pre><code>'admin' =&gt; [
            'type' =&gt; Segment::class,
            'options' =&gt; [
                'route' =&gt; '/admin/:action',
                'defaults' =&gt; [
                    'controller' =&gt; Controller\AdminController::class,
                    'action' =&gt; 'index',
                ],
            ],
            'may_terminate' =&gt; true,
            'child_routes' =&gt; [
                'color' =&gt; [
                    'type' =&gt; Segment::class,
                    'options' =&gt; [
                        'route' =&gt; '/:crud',
                        'constraints' =&gt; [
                            'crud' =&gt; 'add|edit|delete|view',
                        ],
                        'defaults' =&gt; [
                            'controller' =&gt; Controller\AdminController::class,
                            'crud' =&gt; 'view',
                        ],
                    ],
                ],
            ],
            ],
</code></pre>