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 version information available, might only be in SVN)

Lua::registerCallbackEnregistre une fonction PHP en Lua

Description

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

Enregistre une fonction PHP en Lua, portant le nom de "$name".

Liste de paramètres

name

function

Une fonction de rappel PHP valide

Valeurs de retour

Retourne $this, NULL si de mauvais arguments sont passés, ou FALSE si une erreur d'un autre type survient.

Exemples

Exemple #1 Exemple avec Lua::registerCallback()

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

L'exemple ci-dessus va afficher :

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