I am trying to work on a project that uses Twig Template
. Right now, I am learning it and have checked if I can do any alternate for the project as I know how the MVC architecture works. The Twig Template
is different as it has file extension html.twig and the following in it:
{% for user in users %}
<li>{{ user.username | e }}</li>
{% endfor %}
Now for alternate purpose, I've created a controller and view (Not using Twig rules) in the Template
as follows that's very basic:
Controller:
public function index()
{
//return something
}
View:
<html>
<head>
<title>Hello World</title>
</head>
<body>
<p>This is a sample page.</p>
</body>
</html>
As you can see, I am not using the default architecture for the project (It works) and thinking not to use Twig
architecture for the time being. So my question is if I can continue with raw PHP
and basic HTML
in the Twig Template
architecture? Any idea would be appreciated.