g-sal Posted August 21, 2005 Share Posted August 21, 2005 Hi, I've created this object where a programmer can set all these values and the object can print out a div box with all the values formatted. In this div box I'd like to have this free text area that could potentially include images and tables and all sorts of HTML markup. Here's an example of how the code would look like: <?php $event = new Event(); $event->title = "My title"; $event->description = "<p>My description</p>"; $event->display(); ?> Since I'm using Dreamweaver, I'd like the description to be defined outside the php tags so I can make full use of Dreamweavers GUI. The thing is, I don't know if PHP has a syntax that will enable me to do something like this: <?php $event = new Event(); $event->title = "My title"; $event->description = { ?> <img src="..." /><p>description</p> <?php } $event->display(); //etc... ?> Does anyone know is something similar is possible? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/2458-can-you-take-in-html-mark-up-as-a-value/ Share on other sites More sharing options...
Mattyspatty Posted August 21, 2005 Share Posted August 21, 2005 Hi, I've created this object where a programmer can set all these values and the object can print out a div box with all the values formatted. In this div box I'd like to have this free text area that could potentially include images and tables and all sorts of HTML markup. Here's an example of how the code would look like: <?php $event = new Event(); $event->title = "My title"; $event->description = "<p>My description</p>"; $event->display(); ?> Since I'm using Dreamweaver, I'd like the description to be defined outside the php tags so I can make full use of Dreamweavers GUI. The thing is, I don't know if PHP has a syntax that will enable me to do something like this: <?php $event = new Event(); $event->title = "My title"; $event->description = { ?> <img src="..." /><p>description</p> <?php } $event->display(); //etc... ?> Does anyone know is something similar is possible? Thanks! 269857[/snapback] what you are saying should work if im not mistaken, i use similar methods but not with ->, give it a go Quote Link to comment https://forums.phpfreaks.com/topic/2458-can-you-take-in-html-mark-up-as-a-value/#findComment-8169 Share on other sites More sharing options...
g-sal Posted August 22, 2005 Author Share Posted August 22, 2005 Doing: $event->description = { ?> ....... <? } doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/2458-can-you-take-in-html-mark-up-as-a-value/#findComment-8172 Share on other sites More sharing options...
trq Posted August 25, 2005 Share Posted August 25, 2005 and will never work. you cant half assign a value to a variable, jump out of php to do something else then come back to php and expect it to be waiting. besides, what are the curly braces there for? your syntax is whack. Quote Link to comment https://forums.phpfreaks.com/topic/2458-can-you-take-in-html-mark-up-as-a-value/#findComment-8184 Share on other sites More sharing options...
g-sal Posted September 1, 2005 Author Share Posted September 1, 2005 and will never work. you cant half assign a value to a variable, jump out of php to do something else then come back to php and expect it to be waiting. besides, what are the curly braces there for? your syntax is whack. 271195[/snapback] Ok that's what I wanted to know, whether something similar is possible, not whether my syntax is right because i know it's wrong. When it comes to functions or conditional statements you can jump into HTML. For example: <? if ($var = $something) ?> <p>Do this</p> <? } else { ?> <p>Do something else</p> <? } ?> I wanna know if I can store that html in a variable. I like to develop my HTML in Dreamweaver, have Dreamweaver preview the HTML in it's internal browser. That's why I want to know if this is possible. Quote Link to comment https://forums.phpfreaks.com/topic/2458-can-you-take-in-html-mark-up-as-a-value/#findComment-8220 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.