-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3d999ca
commit ff8e911
Showing
4 changed files
with
110 additions
and
93 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
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 |
---|---|---|
@@ -1,44 +1,40 @@ | ||
<?php | ||
|
||
namespace Guacamole; | ||
namespace Guacamole\Template; | ||
|
||
|
||
/** | ||
* summary | ||
*/ | ||
class Clean | ||
class Template | ||
{ | ||
public $template; | ||
public $guacamole; | ||
|
||
/** | ||
* [clean description] | ||
* @param [type] $var [description] | ||
* @return [type] [description] | ||
* summary | ||
*/ | ||
public static function clean( $var ) | ||
{ | ||
|
||
if( is_array( $var ) && !empty( $var ) ){ | ||
foreach( $var as $key => $value ){ | ||
$var[$key] = self::clean( $value ); | ||
} | ||
} | ||
public function __construct( \Guacamole\Guacamole $guacamole ) | ||
{ | ||
$this->guacamole = $guacamole; | ||
} | ||
|
||
$type = gettype( $var ); | ||
if( method_exists( __CLASS__, $type ) ){ | ||
return self::{$type}( $var ); | ||
} | ||
else { | ||
return $var; | ||
} | ||
return self::{$type}( $var ); | ||
} | ||
/** | ||
* [getTemplate description] | ||
* @return [type] [description] | ||
*/ | ||
public function getTemplate() :string | ||
{ | ||
return (string)$this->template; | ||
} | ||
|
||
/** | ||
* [text description] | ||
* @param [type] $variable [description] | ||
* @return [type] [description] | ||
*/ | ||
public static function text( $variable ){ | ||
return trim( str_replace( "\n", "", htmlspecialchars( strip_tags( trim( $variable ) ), ENT_QUOTES, "UTF-8" ) ) ); | ||
/** | ||
* [setTemplate description] | ||
* @param string $template [description] | ||
*/ | ||
public function setTemplate( string $template ) :string | ||
{ | ||
return $this->template = $template; | ||
} | ||
|
||
} | ||
} |
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