Thomas Jackson (tjackson) wrote in component_help,
Thomas Jackson

  • Mood:

not entirely component related, but close enough

Hello all I need some enlightenment.

Right now i'm trying to expound on the code functionality of t3knomanser's tutorial on flatboxes. Basically what I'm trying to use, of this tutorial, is the ability to create classes, functions within classes, and then call those functions from within different overrides of the journal. This much I know for certain, it is in effect all over my journal's layout. However there is an area of uncertainty which I shall endeavour to explain below...

I've got the following in my layer...

class chsllamaStuff {
function testFunction(string fred) : string;

function chsllamaStuff::testFunction(string fred) : string {
if ($fred=="cheese") { """
<h1 align=center>CHEESE</h1>
"""; } elseif ($fred=="beef") { """
<h1 align=center>BEEF</h1>
"""; } else { """
<h1 align=center>BURRITO</h1>
"""; }

But when I go to compile it, it get the following error.

Compile error: line 38, column 1: Can't define undeclared object function chsllamaStuff::testFunction(string)
  S2::NodeFunction, S2/, 165
  S2::Checker, S2/, 339
  S2::Compiler, S2/, 34
38: function chsllamaStuff::testFunction(string fred) : string	{

What should I do to get this to work? Do I declare string fred somewhere? the class? I'm lost.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened