PHP code example of k1low / escape

1. Go to this page and download the library: Download k1low/escape library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

k1low / escape example snippets


        class AppController extends Controller {
            var $components = array('Escape.Escape');
        }

## Escape type ##

### use htmlspecialchars() and html_entity_decode() ###

Escape / decode valiables.

* `d()' decode escaped valiables.

app_controller.php example

    
        class AppController extends Controller {
            var $components = array('Escape.Escape');
        }

view.ctp example

     echo $escaped; // echo escaped value; 
 echo d($escaped); // echo decode value; 

        class AppController extends Controller {
            var $components = array('Escape.Escape' => array('objectEscape' => true));
        }

view.ctp example

     echo $escaped; // echo escaped value; 
 echo $escaped->raw; // echo raw value;