-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace q\willow\filter; | ||
|
||
use q\qillow\core\helper as h; | ||
use q\willow; | ||
use q\willow\filter; | ||
|
||
// load it up ## | ||
\q\willow\filter\lowercase::run(); | ||
|
||
class lowercase extends willow\filter { | ||
|
||
public static function run(){ | ||
|
||
// filter variable ## | ||
\add_filter( 'q/willow/render/markup/variable', [ get_class(), 'variable' ], 10, 2 ); | ||
|
||
// filter tag ## | ||
\add_filter( 'q/willow/render/markup/tag', [ get_class(), 'tag' ], 10, 2 ); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
// single variable | ||
public static function variable( $value, $key ) { | ||
|
||
// global first ## | ||
if( isset( self::$filter[self::$args['context']][self::$args['task']]['variables'][$key]['l'] ) ){ | ||
|
||
// h::log( 'e:>Variable tag lowercaseping on: '.self::$args['context'].'->'.self::$args['task'].'->'.$key ); | ||
|
||
// h::log( 'd:>lowercaseping tags from value: '.$value ); | ||
|
||
$value = strtolower( $value ); | ||
// $value = htmlentities( $value, ENT_QUOTES, 'UTF-8' ); | ||
|
||
} | ||
|
||
return $value; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
// whole tag | ||
public static function tag( $value, $key ) { | ||
|
||
// h::log( self::$args ); | ||
|
||
// global first ## | ||
if( isset( self::$filter[self::$args['context']][self::$args['task']]['global']['l'] ) ){ | ||
|
||
// h::log( 'e:>Global tag lowercaseping on: '.self::$args['context'].'->'.self::$args['task'].'->'.$key ); | ||
|
||
// h::log( 'd:>lowercaseping tags from value: '.$value ); | ||
|
||
$value = strtolower( $value ); | ||
// $value = htmlentities( $value, ENT_QUOTES, 'UTF-8' ); | ||
|
||
} | ||
|
||
return $value; | ||
|
||
} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace q\willow\filter; | ||
|
||
use q\qillow\core\helper as h; | ||
use q\willow; | ||
use q\willow\filter; | ||
|
||
// load it up ## | ||
\q\willow\filter\uppercase::run(); | ||
|
||
class uppercase extends willow\filter { | ||
|
||
public static function run(){ | ||
|
||
// filter variable ## | ||
\add_filter( 'q/willow/render/markup/variable', [ get_class(), 'variable' ], 10, 2 ); | ||
|
||
// filter tag ## | ||
\add_filter( 'q/willow/render/markup/tag', [ get_class(), 'tag' ], 10, 2 ); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
// single variable | ||
public static function variable( $value, $key ) { | ||
|
||
// global first ## | ||
if( isset( self::$filter[self::$args['context']][self::$args['task']]['variables'][$key]['u'] ) ){ | ||
|
||
// h::log( 'e:>Variable tag uppercaseping on: '.self::$args['context'].'->'.self::$args['task'].'->'.$key ); | ||
|
||
// h::log( 'd:>uppercaseping tags from value: '.$value ); | ||
|
||
$value = strtoupper( $value ); | ||
// $value = htmlentities( $value, ENT_QUOTES, 'UTF-8' ); | ||
|
||
} | ||
|
||
return $value; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
// whole tag | ||
public static function tag( $value, $key ) { | ||
|
||
// h::log( self::$args ); | ||
|
||
// global first ## | ||
if( isset( self::$filter[self::$args['context']][self::$args['task']]['global']['u'] ) ){ | ||
|
||
// h::log( 'e:>Global tag uppercaseping on: '.self::$args['context'].'->'.self::$args['task'].'->'.$key ); | ||
|
||
// h::log( 'd:>uppercaseping tags from value: '.$value ); | ||
|
||
$value = strtoupper( $value ); | ||
// $value = htmlentities( $value, ENT_QUOTES, 'UTF-8' ); | ||
|
||
} | ||
|
||
return $value; | ||
|
||
} | ||
|
||
|
||
} |