Categories > TinyButStrong general >

Object Oriented Programming

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: mgb
Date: 2007-12-20
Time: 14:24

Object Oriented Programming

Hi all, and Marry Christmas.


I have a configuration class that looks like this
class config {
  const root = '/home/web/site.dk';
  const doc_root = '/home/web/site.dk/root';
  ...
  conts templates = '/home/web/site.dk/data/templates';
}
// And I use it like this in php
include(config::doc_root.'/top.html');

Is there a way to call this with [var.]?
Since this is never initialized I dont know if $__tbs->ObjectRef is the right way to go?
By: Skrol29
Date: 2007-12-22
Time: 23:55

Re: Object Oriented Programming

Hello,

You can display a global constant using [var..cst.MY_CONSTANT] but not yet a constant of class.

You can arrange the following tip & trick to work for your problem:
http://www.tinybutstrong.com/forum.php?msg_id=2187#
By: Andy Schmitt
Date: 2008-04-09
Time: 22:02

Re: Object Oriented Programming

Skrol,

The ability to reference class constants from TBS is definitely on my wishlist. We're using method workarounds for this right now, but it's really nice to be rid of the workaround for defines, and we'd love to see class constants available without workarounds too.