Controller, view, module config

hello, someone could help me, I am new in the use of the framework of lamina, then I encountered the problem that I do not know how to put my controller with my view, I created my controller called testcontroller, and created my view called test.phtml even added it to the configuration file module.config.php I added the name of the controller but I get an error, then down in view manager in application I added the path to my new view, but I get an error, could you help me?


Welcome to the forum :slight_smile:

Your error is not because of the view. Are you using Laminas component installer? What steps did you go through to add Laminas\Form to your project?

Well, I remember that when he asked me about a minimalist installation I said no and to all the other components like db and other things, yes. But I honestly don’t understand anything, I just installed it yesterday and I’m very confused.

I create a new project, but the controller still doesn’t work when i try to have a variable, like i wanna send a mensaje into the action
class PruebasController extends AbstractActionController
public function indexAction(): ViewModel
$message = ‘hi from indexAction’;
return new ViewModel([‘message’ => $message]);

and the view

Hola desde el modulo To Do App!

You said "<?php echo $this->message ?>".

the variable message send me a error like i wouldn't declare before

@Emma, You need to comment out the line Laminas Form from your modules.config.php file which is located in the config directory. As you’re new to the framework the following configuration will work for you or you can comment out the line Laminas\Form like below. Also, you can hire me to teach you basic Laminas MVC for $30 per hour. Thanks!

return [
// 'Laminas\Form',

Thank you so much, but, still doesn´t work :c

Did your error change?

She had a broken install. It was a very tight timeline for a school project so I assisted via slack.

1 Like