Re: Printing Variable in thtml
The proper way to do this seems to be echo $html->tagValue('Order/dateoforder'); tagValue() is in the API for HtmlHelper, but maybe hard to find if you don't know what you're looking for. This will work whether the dateoforder was just sent by a form or if you set the data in your controller with $this->data['Order']['dateoforder'] = $some_date If you use $this->set('data', $this->data); then you won't be able to output the $data values with tagValue() or any other HtmlHelper form functions, which defeats the whole purpose of using $data. At least, It doesn't work for me that way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Printing Variable in thtml
Thanks alot. I had to ad a ['0'] On May 18, 2:53 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > > I have looked in the htmlhelper api and cant find anything for this. > > > echo $html->input('Order/dateoforder', array('size' => '53') > > > Htmlhelper just echos form elements I just want echo the value of > > Order/dateoforder onscreen. > > How do I do this, I looked in the API but cant find it. > > assuming you've set the data to the view in your controller like so: > > $this->set('data', $this->data); > > this will give you a variable $data in your view, so you can get to > dateoforder like so: > > > > on a side note, to help you with rapid prototyping with Scaffolding or > using the Bake functionality, you might want to follow database naming > conventions more, by using _ underscores in table names/field names, > like so: > > date_of_order rather than dateoforder > > this would mean when using scaffolding, Cake will be able to make the > field name into a human readable name, eg: Date of order, it can't do > that without the underscores. > > hth > > jon > > -- > > jon bennett > t: +44 (0) 1225 341 039 w:http://www.jben.net/ > iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Printing Variable in thtml
Read: http://manual.cakephp.org/chapter/controllers http://manual.cakephp.org/chapter/views For example, depending on the controller/view, your example could be as simple as: echo $order['dateoforder'] ... On May 18, 6:03 am, Enchy <[EMAIL PROTECTED]> wrote: > Hi > > I have looked in the htmlhelper api and cant find anything for this. > > echo $html->input('Order/dateoforder', array('size' => '53') > > Htmlhelper just echos form elements I just want echo the value of > Order/dateoforder onscreen. > How do I do this, I looked in the API but cant find it. > > L --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Printing Variable in thtml
> I have looked in the htmlhelper api and cant find anything for this. > > echo $html->input('Order/dateoforder', array('size' => '53') > > Htmlhelper just echos form elements I just want echo the value of > Order/dateoforder onscreen. > How do I do this, I looked in the API but cant find it. assuming you've set the data to the view in your controller like so: $this->set('data', $this->data); this will give you a variable $data in your view, so you can get to dateoforder like so: on a side note, to help you with rapid prototyping with Scaffolding or using the Bake functionality, you might want to follow database naming conventions more, by using _ underscores in table names/field names, like so: date_of_order rather than dateoforder this would mean when using scaffolding, Cake will be able to make the field name into a human readable name, eg: Date of order, it can't do that without the underscores. hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Printing Variable in thtml
Hi I have looked in the htmlhelper api and cant find anything for this. echo $html->input('Order/dateoforder', array('size' => '53') Htmlhelper just echos form elements I just want echo the value of Order/dateoforder onscreen. How do I do this, I looked in the API but cant find it. L --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---