Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[textile] Calling classTextile.php functions... what am I doing wrong?
I’ve got a simple little project that includes the need to display standard text stored in a database field as html. Given that it is so simple (no formatting, just line breaks), I figured that a simple solution was to use classTextile.php. Can I get it to work… can I heck!
All I’ve been able to find to instruction me on how to use the library is this link , which indicates that Textile() and TextileThis() are the only functions I should need.
So, what am I doing wrong in the simple test below?
<?php
include 'classTextile.php';
$text = 'Just to prove that we are here';
echo '<p>'.$text.'</p>';
$text = 'Are we still here... good';
TextileThis($text);
?>
I also tried with a couple of parameters (pinching it from line 761 of txplib_wrapper.php, 'cause I know that works).
Stuart
Offline
Re: [textile] Calling classTextile.php functions... what am I doing wrong?
The file, classTextile.php
, contains a class called Textile
, and the TextileThis()
is a method. First create an instance of Textile, and then go from there.
$textile = new Textile();
$textile->TextileThis('I am Content.');
Offline
Re: [textile] Calling classTextile.php functions... what am I doing wrong?
Thanks for the response. After a little while exploring my ignorance of the topic, I know understand. To be clear, the new working version of the above code is as follows:
<?php
include 'classTextile.php';
$text = 'Just to prove that we are here';
echo '<p>'.$text.'</p>';
$textile = new Textile();
$text = 'Are we still here... good';
echo $textile->TextileThis($text);
?>
Stuart
Offline