私のアプリでは、多様なバンドルが2つあります。BaseBundle
とUserBundle
です。 私がUserBundle
のコントローラの1つにいるとき、どのようにしてBaseBundle
で利用可能な機能にアクセスできますか?Symfony2の別のバンドルの関数を呼び出す
私はUserBundle
中だと私のような何かをしようとしている:
$property['x'] = $this->calculateNumber(array($propertyX->indexX, $propertyY->indexY));
これは私が取得エラーです:
Attempted to call method "calculateNumber" on class "Example\UserBundle\Controller\DefaultController".
500 Internal Server Error - UndefinedMethodException
メソッドを静的にしますか? – DevDonkey