OphCoTherapyapplication_Processor::getPDFContentForSide PHP Method

getPDFContentForSide() public method

public getPDFContentForSide ( $controller, $template_data, $side )
    public function getPDFContentForSide($controller, $template_data, $side)
    {
        if ($template_data['suitability']->{$side . '_nice_compliance'}) {
            $file = $this->getViewPath() . DIRECTORY_SEPARATOR . 'pdf_compliant';
        } else {
            $file = $this->getViewPath() . DIRECTORY_SEPARATOR . 'pdf_noncompliant';
        }
        $template_code = $template_data['treatment']->template_code;
        if ($template_code) {
            $specific = $file . '_' . $template_code . '.php';
            if (file_exists($specific)) {
                $file = $specific;
            } else {
                $file .= '.php';
            }
        } else {
            $file .= '.php';
        }
        if (file_exists($file)) {
            return $controller->renderInternal($file, $template_data, true);
        }
        return;
    }