phpti icon indicating copy to clipboard operation
phpti copied to clipboard

Feature Request: Simple String Block

Open kcrwfrd opened this issue 13 years ago • 0 comments

It would be nice if there was a function to set a small string, rather than a whole block of markup. For example, I like to pass a class attribute from each page to its base layout.

I've written my own way to accomplish it for now, but I feel like it could be done better. I added this function to ti.php:

function set($key, $value){
    startblock($key, 'trim');
    echo $value;
    endblock($key);
}

To use it, in the layout file I use<?php emptyblock('class'); ?> or <?php set('class', 'default'); ?> to set it In the child page, I write <?php set('class', 'class-name'); ?>

Thanks for this handy little library!

kcrwfrd avatar Feb 18 '12 02:02 kcrwfrd