$this->getRequest()->getParams(); //Retrieves all parameters sent
$this->getRequest()->getPost(); //Retrieves the post array
$form->getValues(); //retrieves form values
これらは、リクエストオブジェクトで作業する一般的な方法です、彼らは
ではありませんこれは、URLパラメータがモジュール、コントローラ、アクション、駅= 1であることを$this->getRequest()->getParams();
お知らせから期待するものです提出=これは、使用して同じ要求である
Params array(5) {
["module"] => string(5) "admin"
["controller"] => string(5) "index"
["action"] => string(5) "index"
["station"] => string(1) "1"
["submit"] => string(6) "Submit"
}
を提出$this->getRequest()->getPost();
Post array(2) {
["station"] => string(1) "1"
["submit"] => string(6) "Submit"
}
これらの値を自分で使用するにはZend_Debug :: dump($ var、 'label'); Zend Frameworkで作成されました。
このecho $_GET['id'];
はZFでは非常に悪い習慣とみなされます。
簡単な操作のために行く途中に見えます。 ZF内のURLは、(あなたがそれを変更しない限り)常にキー値のペアです。あなたがURLを知っているなら、あなたはパラメータを知っています。 www.example.com/key/value/key/value – RockyFord