Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d39c3a6

Browse files
Controller class
1 parent 54d00db commit d39c3a6

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

‎index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
require 'system/config.php';
33
require 'system/core/Router.php';
4+
require 'system/core/Controller.php';
45

56
$router = new Router();
67
echo '<pre>';
@@ -12,4 +13,7 @@
1213
$param = $router->getParam();
1314
echo "Controlador: {$controlador} </br>";
1415
echo "Método: {$method} </br>";
15-
echo "Param: {$param} </br>";
16+
echo "Param: {$param} </br>";
17+
18+
$controller = new $controlador();
19+
$controller->$method();

‎system/core/Controller.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Controlador base
4+
*/
5+
class Controller
6+
{
7+
/**
8+
* object
9+
*/
10+
private $view;
11+
12+
/**
13+
* Inicializa la vista
14+
*/
15+
public function __construct()
16+
{
17+
echo __CLASS__ . ' instanciado';
18+
}
19+
20+
/**
21+
* Metodo estándar
22+
*/
23+
public function exec()
24+
{
25+
echo '</br>Ejecutando método exec()</br>';
26+
}
27+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /