Suitecrm - php code in pdf template

为君一笑 提交于 2019-12-23 19:26:38

问题


I want to add a php code in my pdf template. Here is my use case

First is I have a dropdown on my own module:

Then what I want to have is on my pdf template, I want to have php condition base on the value of my dropdown e.g

if($client_type == "renewal") echo "x"; else echo "y";

Will this be possible?


回答1:


You could add a placeholder in the pdf template, for example:

%%renewal_value%%

Then you can work out your required value like you described, but rather than echoing the value use str_replace

$bean = BeanFactory::getBean('AOS_PDF_Templates', 'some-id');
$value = ($client_type == "renewal") "x": "y";
str_replace('%%renewal_value%%', $value, $bean->description);


来源:https://stackoverflow.com/questions/43860526/suitecrm-php-code-in-pdf-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!