[ZendFramework 2] 頁面接值

在 Zend Framework 2 頁面接值可使用 Zend\Mvc\Controller\Plugin\Params

Controller Plugins 預設會被預先載入,所以不需要額外用 use 宣告。

1
2
3
4
5
$this->params()->fromRoute(); // Route Match
$this->params()->fromHeader(); // Header
$this->params()->fromQuery(); // Get
$this->params()->fromPost(); // Post
$this->params()->fromFiles(); // Files

Reference: Zend Controller Plugins

Licensed under CC BY-NC-SA 3.0 TW
comments powered by Disqus