Skip to content

Instantly share code, notes, and snippets.

@tanrax
Created January 31, 2014 15:38
Show Gist options
  • Save tanrax/8734400 to your computer and use it in GitHub Desktop.
Save tanrax/8734400 to your computer and use it in GitHub Desktop.
PHP: Autocargador de bibliotecas (librerias)
<?php
/** Autocargador de librerias **/
spl_autoload_register('autocargador');
function autocargador($insNom)
{
include $insNom . '.class.php';
}
/**
* Clase que carga una librería
*/
class HolaMundo
{
public $miRestaurante = null;
function __construct()
{
$this->miRestaurante = new Restaurante();
echo $this->miRestaurante->iNum;
}
}
new HolaMundo();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment