Skip to content

Commit

Permalink
Added \Phalcon\Tag::getAutoescape()
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Sep 21, 2013
1 parent 29c91a1 commit 2421a54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ext/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,21 @@ PHP_METHOD(Phalcon_Tag, getEscaperService){
RETURN_CCTOR(escaper);
}

/**
* Get current autoescape mode
*
* @return bool
*/
PHP_METHOD(Phalcon_Tag, getAutoescape) {

zval *autoescape;

PHALCON_MM_GROW();
PHALCON_OBS_VAR(autoescape);
phalcon_read_static_property(&autoescape, SL("phalcon\\tag"), SL("_autoEscape") TSRMLS_CC);
RETURN_CCTOR(autoescape);
}

/**
* Set autoescape mode in generated html
*
Expand Down
2 changes: 2 additions & 0 deletions ext/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ PHP_METHOD(Phalcon_Tag, setDI);
PHP_METHOD(Phalcon_Tag, getDI);
PHP_METHOD(Phalcon_Tag, getUrlService);
PHP_METHOD(Phalcon_Tag, getEscaperService);
PHP_METHOD(Phalcon_Tag, getAutoescape);
PHP_METHOD(Phalcon_Tag, setAutoescape);
PHP_METHOD(Phalcon_Tag, setDefault);
PHP_METHOD(Phalcon_Tag, setDefaults);
Expand Down Expand Up @@ -216,6 +217,7 @@ PHALCON_INIT_FUNCS(phalcon_tag_method_entry){
PHP_ME(Phalcon_Tag, getDI, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, getUrlService, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, getEscaperService, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, getAutoescape, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, setAutoescape, arginfo_phalcon_tag_setautoescape, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, setDefault, arginfo_phalcon_tag_setdefault, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(Phalcon_Tag, setDefaults, arginfo_phalcon_tag_setdefaults, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
Expand Down

0 comments on commit 2421a54

Please sign in to comment.