Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty Tags in MySql Row

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
institutocriap
Smarty n00b


Joined: 17 Jul 2018
Posts: 2

PostPosted: Tue Jul 17, 2018 3:45 pm    Post subject: Smarty Tags in MySql Row Reply with quote

Hello, i need some help.
I have a php function with Query.
In one colum from BD i have in backend an html editor.
I want, if users try to write Smarty Tags, like an example:

{TestSmarty Name="Angelo"}

in my function find all smarty tags and replace with content.

My function is some like this

Code:

function Testing(){

try{
$sql = 'SELECT Content FROM Table';
$stmt = $CONECTION->prepare($sql);
$stmt->execute();   
$result = $stmt->fetch(PDO::FETCH_ASSOC);
}
    catch(PDOException $ex){
      $ex->getMessage();
     }   

}




The Content Column in database have
{TestSmarty Name="Angelo"}

How assign TestSmarty from my query?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1317

PostPosted: Tue Jul 17, 2018 6:48 pm    Post subject: Reply with quote

Please read the documentation. Particularly, section III. Smarty for programmers, chapter 18. Extending Smarty with plugins: Template functions.
Back to top
View user's profile Send private message
institutocriap
Smarty n00b


Joined: 17 Jul 2018
Posts: 2

PostPosted: Wed Jul 18, 2018 8:21 am    Post subject: Reply with quote

AnrDaemon wrote:
Please read the documentation. Particularly, section III. Smarty for programmers, chapter 18. Extending Smarty with plugins: Template functions.


A read, but i dont understand how can do this, can you provide some light to start?an example please?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1317

PostPosted: Wed Jul 18, 2018 12:18 pm    Post subject: Reply with quote

If only you have actually read it, you'd see all the examples.
Please stop lying.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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