Can you please write a comment about what is it supposed to do? From what I understand you enter the if if the name route has a slash. What about removing the if and doing:

```php
$childName = end(explode('/', $options['name'], 2));
```

( may need to split the expression in two, not sure this is supported).