diff --git a/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php b/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php index 1441c3e6cf..50279192bc 100644 --- a/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php +++ b/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php @@ -992,12 +992,17 @@ public function getBehaviorContentBase($contentName, $modifier) * * @param string $filename * @param array $vars - * @param string $templateDir + * @param string|null $templateDir * @return string */ - public function renderTemplate($filename, $vars = [], $templateDir = '/templates/') + public function renderTemplate($filename, $vars = [], $templateDir = null) { - $filePath = __DIR__ . $templateDir . $filename; + if (!$templateDir) { + $filePath = __DIR__ . '/templates/' . $filename; + } else { + $filePath = $templateDir . $filename; + } + if (!file_exists($filePath)) { // try with '.php' at the end $filePath = $filePath . '.php';