lims Posted March 13, 2019 Share Posted March 13, 2019 want to know write {$systemurl} for PDF anyone please help... already try follow this https://developers.whmcs.com/themes/variables/ but did not get function write 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 13, 2019 Share Posted March 13, 2019 I presume you mean on invoicepdf.tpl or quotepdf.tpl? If so, I do not believe smarty is actually used for that and so using {$systemurl} wont work. 0 Quote Link to comment Share on other sites More sharing options...
lims Posted March 13, 2019 Author Share Posted March 13, 2019 11 minutes ago, steven99 said: I presume you mean on invoicepdf.tpl or quotepdf.tpl? If so, I do not believe smarty is actually used for that and so using {$systemurl} wont work. it is true need for invoicepdf.tpl , when using this $companyurl its work but this come to base domain setup, so i need for subdomain or sub directory work. i'm using barcode in my invoice PDF, for temporary using manual url to do it any some idea ? 0 Quote Link to comment Share on other sites More sharing options...
lims Posted March 13, 2019 Author Share Posted March 13, 2019 same as issues with my thread before 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 14, 2019 Share Posted March 14, 2019 13 hours ago, lims said: any some idea ? as you have found, $companyurl will work (which is the value from general settings -> general -> domain), but $systemurl isn't passed to the template - therefore, there are three solutions that I can think of off-hand... manually hardcode it in the template (as you have currently) - if you're not going to change your systemURL frequently, then there's probably no harm in doing that. use the Class documentation to obtain the setting... use WHMCS\Config\Setting; $systemURL = Setting::getValue('SystemURL'); adding that code to the top of the invoicepdf.tpl, anywhere after the <?php and before you want to use the variable, will work... when you want to output the System URL setting, you can just use $systemURL in the template wherever you want. similar to 2, you query the tblconfiguration database table direct using Capsule... use WHMCS\Database\Capsule; $systemURL = Capsule::table('tblconfiguration')->where('setting','SystemURL')->value('value'); again, adding that code to the top of the invoicepdf.tpl, anywhere after the <?php and before you want to use the variable, will work... when you want to output the System URL setting, you can just use $systemURL in the template. 1 Quote Link to comment Share on other sites More sharing options...
edvancombr Posted March 14, 2019 Share Posted March 14, 2019 Another way would be to use a global variable. $CONFIG['SystemURL']; 6 hours ago, brian! said: use WHMCS\Config\Setting; $systemURL = Setting::getValue('SystemURL'); These 2 options will return the URL without the slash at the end. 6 hours ago, brian! said: use WHMCS\Database\Capsule; $systemURL = Capsule::table('tblconfiguration')->where('setting','SystemURL')->value('value'); This will return the URL with the slash at the end. https://domain.whmcs.com/ 1 Quote Link to comment Share on other sites More sharing options...
lims Posted March 15, 2019 Author Share Posted March 15, 2019 18 hours ago, brian! said: as you have found, $companyurl will work (which is the value from general settings -> general -> domain), but $systemurl isn't passed to the template - therefore, there are three solutions that I can think of off-hand.... use the Class documentation to obtain the setting... use WHMCS\Config\Setting; $systemURL = Setting::getValue('SystemURL'); adding that code to the top of the invoicepdf.tpl, anywhere after the <?php and before you want to use the variable, will work... when you want to output the System URL setting, you can just use $systemURL in the template wherever you want. i'm using option 2.. this work perfect thanks you so much @brian! and @edvancombr 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 15, 2019 Share Posted March 15, 2019 18 hours ago, edvancombr said: Another way would be to use a global variable. the only reason that I didn't include that as an option was because in a previous post, one of the WHMCS developers suggested not to use it... now whether that's a personal preference of his or $CONFIG is getting deprecated at some point, I don't know... although as of today, it's still perfectly acceptable to use it. 🙂 0 Quote Link to comment Share on other sites More sharing options...
edvancombr Posted March 15, 2019 Share Posted March 15, 2019 1 minute ago, brian! said: the only reason that I didn't include that as an option was because in a previous post, one of the WHMCS developers suggested not to use it... now whether that's a personal preference of his or $CONFIG is getting deprecated at some point, I don't know... although as of today, it's still perfectly acceptable to use it. 🙂 I was not aware of this information. The curious thing that keeps on working. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.