0

Start to explore new CakePHP 3 installation today. I saw the following function in the controller in CakePHP 3 with the new installation.

class PagesController extends AppController {
    public function display(...$path) {
        print($path);
    }
}

The printed result is as following:

Array (
    [0] => home
)

The home value comes from the following routing definition.

$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

My question is what does the ...sign before the parameter $pathvariable do? I have never seen that technique before.

O Connor
  • 4,236
  • 15
  • 50
  • 91

0 Answers0