I'm twiting

访问统计

free counters

Symfony中获取POST或GET的方法

public function executeTest()
{
$hasName = $this->getRequest()->hasParameter(’name’);
$hasName = $this->hasRequestParameter(’name’); // Shorter version
var_dump( $hasName );
$name = $this->getRequest()->getParameter(’name’);
$name = $this->getRequestParameter(’name’); // Shorter version
var_dump( $name );
return sfView::NONE;
}

Symfony coding standards(Symfony 代码规范)

In the code examples given in this book, you probably noticed that the opening and closing curly braces ({ and }) occupy one line each. This standard makes the code easier to read.
{ 和 } 各占一行, 这样的好处是是代码更易于阅读。

Among
the other coding standards of the framework, indentation is always done
by two blank spaces; tabs are not used. This [...]