|
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 |
tatom2007 Smarty Rookie
Joined: 22 Feb 2007 Posts: 10 Location: cairo,EGYPT
|
Posted: Thu Feb 22, 2007 3:38 pm Post subject: AJAX plugins....any help?? |
|
|
Hello everybody,
As this is my first subject.....I'm sorry that it comes with a question.
I just started with smarty two days ago...and I want to make a plugin to do some AJAX...from a library like YUI.
the problem is how can I handle the files sources in script tag like:
Code: | <script type="text/javascript" src="js/yahoo.js"></script> |
may be it's easy but I can't get it right now...
thnx |
|
Back to top |
|
JasonDS Smarty Rookie
Joined: 25 Jan 2007 Posts: 25
|
Posted: Thu Feb 22, 2007 4:53 pm Post subject: |
|
|
Code: |
{literal}
<script type="text/javascript" src="js/yahoo.js"></script>
{/literal}
|
^^ |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Feb 22, 2007 5:07 pm Post subject: |
|
|
There is no need to wrap that in literals.
@tatom2007: What is the problem? |
|
Back to top |
|
Hielke Hoeve Smarty Elite
Joined: 06 Jan 2006 Posts: 406 Location: Netherlands
|
Posted: Sat Feb 24, 2007 12:45 pm Post subject: |
|
|
Probably a path thing... _________________ Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net> |
|
Back to top |
|
tatom2007 Smarty Rookie
Joined: 22 Feb 2007 Posts: 10 Location: cairo,EGYPT
|
Posted: Mon Feb 26, 2007 8:17 am Post subject: |
|
|
sorry for my latency.....
I wanted to make a plugin to make AJAX in my template
by YUI library so I made this plugin and thank GOD it works
Code: | <?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty Ajax panel plugin
*
* Type: modifier<br>
* Name: button_AJAX <br>
* Purpose: make AJAX reset button
* @author mohamed-tamer<tatom2000@yahoo.com>
* @param string
* @return
*/
function smarty_modifier_button_AJAX($value,$type){
// generate random number
$randNum= mt_rand();
$output = "<link type='text/css' rel='stylesheet' href='templates/css/fonts.css'>";
$output.= "<link type='text/css' rel='stylesheet' href='templates/css/reset.css'>";
$output.= "<script type='text/javascript' src='templates/js/yahoo-dom-event.js'></script>";
$output.= "<script type='text/javascript' src='templates/js/element-beta.js' ></script>";
$output.= "<script type='text/javascript' src='templates/js/button-beta.js' ></script>";
$output.= "<link type='text/css' rel='stylesheet' href='templates/css/but_assets/button.css'>";
$output.= "<script type='text/javascript'>";
$output.= "var oButton = new YAHOO.widget.Button({ type:'".$type."', label:'".$value."', id:'SRbutton".$randNum."', name:'SRButton".$randNum."' , value:'go".$type."' , container: 'here".$randNum."' });";
$output.= "</script>";
$output.= "<fieldset id='herebuttons'>";
$output.= "<fieldset id='here".$randNum."'>";
$output.= "</fieldset>";
$output.= "</fieldset>";
return $output;
}
?> |
I'm a begginer in both PHP and smarty....so any advices are welcomed |
|
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
|