How tu execute plug-in in module...

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
pjanda79
New Member
New Member
Posts: 6
Joined: Fri May 15, 2015 6:29 am

How tu execute plug-in in module...

Post by pjanda79 »

Hello,

I've done plugin in plugins dir... and it works in templates correctly... But is there any chance to run my smarty_cms_function_something() in module? - for examle if I want tu run cms_version "tag" witch is plugin in php of module...

Thank you!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How tu execute plug-in in module...

Post by Dr.CSS »

If you look under extensions > plugins page then hit the name of the plugin they will tell you how to use it most times...
pjanda79
New Member
New Member
Posts: 6
Joined: Fri May 15, 2015 6:29 am

Re: How tu execute plug-in in module...

Post by pjanda79 »

Yes, usually there is help for each plugin... But it shows smarty tag usage only... And I want to use plugin-function in module - it means in PHP code of any module... something like

Code: Select all

$class_name->cms_version($params,...);


Thank you. Pavel
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: How tu execute plug-in in module...

Post by Jo Morg »

pjanda79 wrote:And I want to use plugin-function in module
You can't, not like that. You may use smarty to evaluate a template, and for that you'd need to do something like:

Code: Select all

$result = $smarty->fetch('eval:{aSmartyTag}');
But it is slow and usually it should be avoided. Most of the time there are better ways to get what you want by using PHP: all plugins are made of PHP native code so you may be better off checking the source code and reproduce it... for instance: {cms_version} is just:

Code: Select all

global $CMS_VERSION;
return $CMS_VERSION;
... why would you need to call a smarty tag from PHP just for that?
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “The Lounge”