Bonjour,

Après avoir galéré a faire fonctionné mon application avec apache, l'index fonctionne correctement

Par contre une fois que je clique sur le lien dans mon index, j'ai le code php de mon index.php qui s'affiche.

Il devrait afficher un formulaire.

Je précise que j'utilise Phalcon.

Voici les fichiers :

public/index.php :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
use Phalcon\Di\FactoryDefault;
 
error_reporting(E_ALL);
 
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');
 
try {
 
    /**
     * The FactoryDefault Dependency Injector automatically registers
     * the services that provide a full stack framework.
     */
    $di = new FactoryDefault();
 
    /**
     * Handle routes
     */
    include APP_PATH . '/config/router.php';
 
    /**
     * Read services
     */
    include APP_PATH . '/config/services.php';
 
    /**
     * Get config service for use in inline setup below
     */
    $config = $di->getConfig();
 
    /**
     * Include Autoloader
     */
    include APP_PATH . '/config/loader.php';
 
    /**
     * Handle the request
     */
    $application = new \Phalcon\Mvc\Application($di);
 
    echo str_replace(["\n","\r","\t"], '', $application->handle()->getContent());
 
} catch (\Exception $e) {
    echo $e->getMessage() . '<br>';
    echo '<pre>' . $e->getTraceAsString() . '</pre>';
}
 
?>
app/views/index/index.phtml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php    
 
echo '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">' ;
 
echo "<h1 class='text-center text-success'>Hello!</h1>";
 
echo PHP_EOL;
 
echo PHP_EOL;
 
echo $this->tag->linkTo(
    [
        "signup",
        "Sign Up Here!",
        "class" => "btn btn-outline-info btn-lg btn-block"
    ]
);    
 
?>
app/controllers/IndexController.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
 
use Phalcon\Mvc\Controller;
 
class IndexController extends Controller
{
    public function indexAction()
    {
 
    } 
}
 
?>
app/controllers/SignupController.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
 
use Phalcon\Mvc\Controller;
 
class SignupController extends Controller
{
    public function indexAction()
    {
 
    }
 
    public function registerAction()
    {
        $user = new Users();
 
        // Store and check for errors
        $success = $user->save(
            $this->request->getPost(),
            [
                "name",
                "email",
            ]
        );
 
        if ($success) {
            echo "Thanks for registering!";
        } else {
            echo "Sorry, the following problems were generated: ";
 
            $messages = $user->getMessages();
 
            foreach ($messages as $message) {
                echo $message->getMessage(), "<br/>";
            }
        }
 
        $this->view->disable();
    }
}
 
?>
app/views/signup/index.phtml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<h2>Sign up using this form</h2>
 
<?php echo $this->tag->form("signup/register"); ?>
 
    <p>
        <label for="name">Name</label>
        <?php echo $this->tag->textField("name"); ?>
    </p>
 
    <p>
        <label for="email">E-Mail</label>
        <?php echo $this->tag->textField("email"); ?>
    </p>
 
    <p>
        <?php echo $this->tag->submitButton("Register"); ?>
    </p>
 
</form>
Avez une idée du pourquoi mon lien m'affiche mon public/index.php ?