Created
August 13, 2014 06:28
-
-
Save MaxLazar/be966c0a9586036d3f82 to your computer and use it in GitHub Desktop.
prep no_results tag for ee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function _prep_no_results() { | |
$td =& ee()->TMPL->tagdata; | |
$open = 'if mx_no_results'; | |
$close = '/if'; | |
if ( strpos( $td, $open ) !== FALSE && preg_match( '#'.LD.$open.RD.'(.*?)'.LD.$close.RD.'#s', $td, $match ) ) { | |
if ( stristr( $match[1], LD.'if' ) ) { | |
$match[0] = ee()->functions->full_tag( $match[0], $td, LD.'if', LD.'\/if'.RD ); | |
} | |
ee()->TMPL->no_results = substr( $match[0], strlen( LD.$open.RD ), -strlen( LD.$close.RD ) ); | |
$td = str_replace( $match[0], '', $td ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment