|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
baturin Smarty n00b
Joined: 29 Oct 2003 Posts: 1 Location: Ekaterinburg, Russia
|
Posted: Wed Oct 29, 2003 5:11 pm Post subject: |
|
|
I have some problem with Spaw when trying to include files within the function. There are some global variables in Spaw class that nothing worked... I solve this by using ob_start, ob_get_content and ob_clean_end in php script that display the template. In the template I simply print the variable. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Oct 30, 2003 12:12 am Post subject: |
|
|
Okay, so maybe you do want to use a plugin for htmlArea. This might start you off.
[php:1:e7f2d5eac6]<?php
/**
* Smarty function plugin
* -------------------------------------------------------------
* Type: function
* Name: editor
* Version: 1.2
* Author: boots
* Purpose: creates a htmlArea based editor control
* -------------------------------------------------------------
* @param name required form name for control
* @param data optional data that control will start with
* @param width optional control width (css units), default: 100%
* @param rows optional text rows to display, default: 20
*/
function smarty_function_editor( $params, &$this )
{
extract ($params);
if (!isset($name) || empty($name)) {
$this->trigger_error('editor: required parameter "name" missing');
} else {
if (!isset($width)) $width = '100%';
if (!isset($rows)) $rows = '20';
if (!isset($data)) $data = '';
$out .= "\n<textarea name=\"$name\" style=\"width:100%;\" rows=20>$data</textarea>\n";
$out .= "<script language=\"JavaScript1.2\" defer>\n";
$out .= " editor_generate('$name');\n";
$out .= "</script>\n";
return $out;
}
}
?>[/php:1:e7f2d5eac6] |
|
Back to top |
|
mystrymaster Smarty Rookie
Joined: 31 Oct 2003 Posts: 17
|
Posted: Thu Nov 13, 2003 2:06 pm Post subject: |
|
|
I am having no troubles getting spaw to work with smarty what are the issues that you are having? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Nov 13, 2003 2:55 pm Post subject: |
|
|
I had almost every problem with SPAW. Yet almost none with htmlArea. I've never got SPAW to a state that I thought was satisfactory with Smarty. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|