17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1190 Views |
-
Send more than 1 param from template to a model function?

11 May 2007 at 10:30am
How can i send more than 1 parameter from template to this function?
class ProductPage_Image extends Image {
function generateThumbnail(GD $gd, $width, $heigth) {
$gd->setQuality(90);
return $gd->paddedResize($width,$heigth,"F0F0F0");
}
public function Thumbnail($width,$heigth)
{
return $this->getFormattedImage('Thumbnail',$width, $heigth);
}
}i try:
<ul id="ListaProductos">
<% control Children %>
<li>
<div class="Productonombre"><a href="$Link">$Title</a></div>
<div class="Productofoto">$Foto.Thumbnail(80,70)</div>
<div class="Productodescripcion"><p>$Content.FirstSentence</p></div>
</li>
<% end_control %>But dint work, i get 1 parameter missing for Thumbnail function.
Thanks
-
Re: Send more than 1 param from template to a model function?

11 May 2007 at 3:52pm
The templating language has some weird little quirks in it.
Instead of:
$Foto.Thumbnail(80,70)
Try:
<% control Foto %>
$Thumbnail(80,70)
<% end_control %>While we're on the subject, if anyone want to try and help rewrite the SSViewer parser, I'd be very appreciative and happy to point them in the right direction.
Basically, it's currently built as a mess of regular expression search-and-replaces. It needs to be turned into a more sophisicated parser that uses a regular expression to find the <% control %> and $ tags, and something based on explode() and a for loop to work out how to parse the field/method reference itself.
-
Re: Send more than 1 param from template to a model function?

11 May 2007 at 11:23pm
Thanks i will give it a try.
-
Re: Send more than 1 param from template to a model function?

12 May 2007 at 9:56am
Yes, That resolve my problem tank you very much.
| 1190 Views | ||
|
Page:
1
|
Go to Top |


