?
Solved

PHP Joomla 1.5 Module Creation with system-message

Posted on 2008-10-23
4
Medium Priority
?
1,487 Views
Last Modified: 2012-05-05
Gday Experts,

I have created a simple contact module, when the user submits the form, it either says 'mail sent' or 'failed', I wish to display this information in system message/jdoc object <jdoc:include type="message" />

What code would I use to add messages to this area?

Sincerely,
-- Zemond
0
Comment
Question by:zemond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:gxp071
ID: 22830149
in a component you just set the message as the second option in the redirect

$this->setRedirect('?option=com_invoice', 'test');

test being the message..

0
 
LVL 9

Author Comment

by:zemond
ID: 22837258
Gday gxp071,

Thanks for the reply, can it be done without performing a redirect?

Sincerely,
0
 
LVL 6

Accepted Solution

by:
gxp071 earned 2000 total points
ID: 22839503
I'm not sure,

ive tracked the function back and its part of the jController class,  it also has a setMessage() method but it just sets it internally and passes it into a redirect.  the setRedirect method calls the _gobal $mainframe->redirect() which is a JApplication instance.

internally redirect() stacks the message using the enqueueMessage() function.  So in theory if you want to add a message to the stack you could try

_gobal $mainframe;
$mainframe->enqueueMessage('Your Message');

But I've never tried it so no idea if it will do what you want.  Sorry I cant be anymore help,  Ive limited experience of creating modules, and I've never try to do this.  Creating components i've always just used a redirect.

Hope this helps though, good luck

PS. have you tired posting on the developer section of the joomla forum?
0
 
LVL 9

Author Closing Comment

by:zemond
ID: 31509172
Much appreciated, thank you for donating your time.

Sincerely
-- Zemond
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question