Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Simple String Block #8

Open
kcrwfrd opened this issue Feb 18, 2012 · 0 comments
Open

Feature Request: Simple String Block #8

kcrwfrd opened this issue Feb 18, 2012 · 0 comments

Comments

@kcrwfrd
Copy link

kcrwfrd commented Feb 18, 2012

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant