PHP Classes
elePHPant
Icontem

File: src/Response/Plugin/JQuery/Call/AttrGet.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu  >  Jaxon  >  src/Response/Plugin/JQuery/Call/AttrGet.php  >  Download  
File: src/Response/Plugin/JQuery/Call/AttrGet.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon
Call PHP classes from JavaScript using AJAX
Author: By
Last change:
Date: 3 months ago
Size: 1,077 bytes
 

 

Contents

Class file image Download
<?php

namespace Jaxon\Response\Plugin\JQuery\Call;

use
JsonSerializable;

class
AttrGet implements JsonSerializable
{
   
/**
     * The attribute name
     *
     * @var string
     */
   
private $sAttrName;

   
/**
     * The constructor.
     *
     * @param string $sAttrName The attribute name
     */
   
public function __construct($sAttrName)
    {
       
$this->sAttrName = (string)$sAttrName;
    }

   
/**
     * Returns a string representation of the script output (javascript) from this call
     *
     * @return string
     */
   
public function getScript()
    {
        return
$this->sAttrName;
    }

   
/**
     * Convert this call to string
     *
     * @return string
     */
   
public function __toString()
    {
        return
$this->getScript();
    }

   
/**
     * Convert this call to string, when converting the response into json.
     *
     * This is a method of the JsonSerializable interface.
     *
     * @return string
     */
   
public function jsonSerialize()
    {
        return
$this->getScript();
    }
}