バリデータ

symfonyのバリデータってPOSTメソッドじゃないとエラーにするとかできないのかな。

<?php
  protected function validate_POST($module = null, $action = null)
  {
    if (is_null($module)) {
      $this->forward404Unless($this->getRequest()->getMethod() == sfRequest::POST);
    } else {
      $this->forwardUnless($this->getRequest()->getMethod() == sfRequest::POST, $module, $action);
    }
  }

こんなメソッドをactionに追加して、

<?php
  public function executePost()
  {
    $this->validate_POST('top', 'index');
  }

executeかvalidateでこんなふうにやってる。

違うのかな。

各モジュールに追加するのがいやだな。
sfActionsを継承したクラスを作ってそっちに入れて、
すべてのモジュールでその継承したクラスを使うようにするのがいいのかな。