Using method of modules in atricles

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
bigmantana
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Feb 08, 2008 12:37 pm

Using method of modules in atricles

Post by bigmantana » Sat Mar 08, 2008 5:53 pm

Hello,
How can I integrate an article with Joomla Methods and using PhP in articles too. My problem is related to activating a paypal button when the user LogIn. I can read the user status by PHP codes to shows the PAYPAL buttons but it seems the PHP codes cannot integrated with article environment even when I disable "Default WYSIWYG Editor"
Is there any ways to accomplish this task ?
Thx

bigmantana
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Feb 08, 2008 12:37 pm

Post by bigmantana » Sat Mar 08, 2008 8:13 pm

I found includePHP in extension manager which seems solve php embedding in articles.
I have a php question. I wanna call a method of a module in an article.
Suppose my module is mod_example and has a method getMe();
as I call mod_example::getMe() through the {php} tag I get error :
Fatal error: Class 'mod_example' not found in /home/test/public_html/plugins/content/includePHP.php(29) : eval()'d code on line 1.
In other world how can I define a global variable in my PHP modules. Is it possible?
Thank you.
Last edited by bigmantana on Sat Mar 08, 2008 8:32 pm, edited 2 times in total.

bigmantana
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Feb 08, 2008 12:37 pm

Re: Using method of modules in atricles

Post by bigmantana » Sat Mar 08, 2008 8:13 pm

I also loaded my module by "loadposition" tag and then tried to used to the variables directly in {php} tags but again the scope of methods are not in my articles.


Post Reply