473,320 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Template WYSIWYG php && tags

Dear developers,
I am trying to find an answer to that rpoblem of mine for a very long
time now... and still I had no luck.

I have my tinyMCE WYSIWYG and I want to let people create an e-mail
template.
So i want the to type in the WYSIWYG :
Dear <?= $subscriber->name ?>,
You have a message from <?= $anotherSubscriber->name ?>
Total messages: <?= $message->countMessages($subscriber->name); ?>
Regards,
Hero

Another version of the above is:
Dear <?= $NAME ?>,
You have a message from <?= $MESSAGE_FROM_NAME ?>
Total messages: <?= $TOTAL_MESSAGES ?>
Regards,
Hero

Ignore the CAPITAL letters.

And the question is... what options do I have of creating that
template in my WYSIWYG store it in a DB and then be able to parse it.
I believe that the most common answer would be using regular
expression and replacing this variables with somthing else. But do you
know any application that works like that... is that a common way to
work ?

Thank you.

Mar 22 '07 #1
1 1989
Aggelos wrote:
Dear developers,
I am trying to find an answer to that rpoblem of mine for a very long
time now... and still I had no luck.

I have my tinyMCE WYSIWYG and I want to let people create an e-mail
template.
So i want the to type in the WYSIWYG :
Dear <?= $subscriber->name ?>,
You have a message from <?= $anotherSubscriber->name ?>
Total messages: <?= $message->countMessages($subscriber->name); ?>
Regards,
Hero

Another version of the above is:
Dear <?= $NAME ?>,
You have a message from <?= $MESSAGE_FROM_NAME ?>
Total messages: <?= $TOTAL_MESSAGES ?>
Regards,
Hero

Ignore the CAPITAL letters.

And the question is... what options do I have of creating that
template in my WYSIWYG store it in a DB and then be able to parse it.
I believe that the most common answer would be using regular
expression and replacing this variables with somthing else. But do you
know any application that works like that... is that a common way to
work ?

Thank you.
Many do. Just search for 'templates php' and you'll see many
examples. It is the most common way to do it. In fact, I can't see
any other good way to do it.

--
Bruno Barberi Gnecco <brunobg_at_users.sourceforge.net>
Mar 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: KJ | last post by:
I would like to know if there is a tool for download or purchase that will generate a skeleton xslt document, inserting all the xsl:template's matching each element specified in any given xsd. ...
5
by: Manuel Maria Diaz Gomez | last post by:
Thanks Victor for your previous answer! I have the following problem: I would like to implement an interface class that defines a pure virtual method that could take any parameter as input, ...
1
by: blugrasmaniac | last post by:
I have discovered that within a <ASP:REPEATER> control, I can specify multiple tags, such as <ItemTemplate> and <AlternatingItemTemplate>. So that I could write code like following: ...
5
by: krema2ren | last post by:
Hi Does some of you know how to declare getCollection() in the cpp file? My code snippet below produces following compile error: foo.cpp(48) : error C2143: syntax error : missing ';' before...
2
by: Glenn G. Chappell | last post by:
I am trying to write two constructors for the same class. One takes an iterator and so is a template. The other takes a particular type by reference to const. class Foo { public:...
12
by: Trish | last post by:
I just had a bad experience using MS Word as an HTML editor. It bloated more than 200% so I could barely recognize the essential statements; and it introduced more than 14,000 errors. Also,...
2
by: hellori | last post by:
Hi all, I have a question about passing iterators to a function. I want to create a function that does something with STL container iterators. The container of the iterator can vary, so I use a...
2
by: dawid | last post by:
Hi, I'm trying to compile this template: 1 #include <set> 2 3 using std::set; 4 5 template <class TYPE> 6 void function(const set<TYPE&data) { 7 for (set<TYPE>::const_iterator iter =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.