downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

LuaClosure> <Lua::include
[edit] Last updated: Fri, 17 May 2013

view this page in

Lua::registerCallback

(No hay información de versión disponible, podría estar únicamente en SVN)

Lua::registerCallbackRegistra una función PHP en Lua

Descripción

public mixed Lua::registerCallback ( string $name , callable $function )

Registra una función PHP en Lua con el nombre de función que se indique en "$name"

Parámetros

name

function

Una función de llamada de retorno válida PHP

Valores devueltos

Devuelve $this, NULL en caso que los argumentos sean erróneos o FALSE para cualquier otro tipo de error.

Ejemplos

Ejemplo #1 Ejemplo de Lua::registerCallback()

<?php
$lua 
= new Lua();
$lua->registerCallback("echo""var_dump");
$lua->eval(<<<CODE
    echo({1, 2, 3});
CODE
);
?>

El resultado del ejemplo sería:

array(3) {
  [1]=>
  float(1)
  [2]=>
  float(2)
  [3]=>
  float(3)
}


add a note add a note User Contributed Notes Lua::registerCallback - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites