Created
September 3, 2011 23:55
-
-
Save gnuget/1191968 to your computer and use it in GitHub Desktop.
Ejemplo de como cambiar la aplicación para cargar una vista
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Access from index.php: | |
*/ | |
if(!defined("_access")) { | |
die("Error: You don't have permission to access here..."); | |
} | |
class Hello_Controller extends ZP_Controller { | |
public function __construct() { | |
$this->app("hello"); | |
$this->Templates = $this->core("Templates"); | |
} | |
public function index() { | |
//Para evitarnos estarle pasando la referencia de en que aplicación va a buscar el view | |
//vamos a simplemente sobreescribir la variable que esta en load.class desde nuestro método | |
$this->application = "blog"; | |
$output = $this->view("main"); | |
print $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment