Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

AJAX plugins....any help??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
tatom2007
Smarty Rookie


Joined: 22 Feb 2007
Posts: 10
Location: cairo,EGYPT

PostPosted: Thu Feb 22, 2007 3:38 pm    Post subject: AJAX plugins....any help?? Reply with quote

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
View user's profile Send private message
JasonDS
Smarty Rookie


Joined: 25 Jan 2007
Posts: 25

PostPosted: Thu Feb 22, 2007 4:53 pm    Post subject: Reply with quote

Code:

{literal}
   <script type="text/javascript" src="js/yahoo.js"></script>
{/literal}

^^
Back to top
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Feb 22, 2007 5:07 pm    Post subject: Reply with quote

There is no need to wrap that in literals.

@tatom2007: What is the problem?
Back to top
View user's profile Send private message
Hielke Hoeve
Smarty Elite


Joined: 06 Jan 2006
Posts: 406
Location: Netherlands

PostPosted: Sat Feb 24, 2007 12:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
tatom2007
Smarty Rookie


Joined: 22 Feb 2007
Posts: 10
Location: cairo,EGYPT

PostPosted: Mon Feb 26, 2007 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP