Hey guys I need help because I am with difficulties on showing the arrays in my website screen.
There is an attachment with my website screen so you can see what kind of error is.
Here it is my UserController.php where I call the translation:
<?php
class UserController extends \Phalcon\Mvc\Controller
{
protected function _getTranslation()
{
//Ask browser what is the best language
$language = $this->request->getBestLanguage();
//Check if we have a translation file for that lang
if (file_exists("app/messages/".$language.".php")) {
require "app/messages/".$language.".php";
} else {
// fallback to some default
require "app/messages/en-US.php";
}
//Return a translation object
return new \Phalcon\Translate\Adapter\NativeArray(array(
"content" => $messages
));
public function indexAction()
{
$this->view->setVar("t", $this->_getTranslation());
}
}
?>
Here it is the index.volt where it is the content:
<div class="introduction-section" id="page-top">
<h1><span class="glyphicon glyphicon-shopping-cart"></span>{{ t_['Do-you-shop-a-lot'] }}?</h1>
<br clear="all">
<ul class="explore btn-explore">
<li><a href="/shop">{{ t_['Shop-Now'] }}</a></li>
</ul>
</div>
<div class="about-section" id="about">
<h1>{{ t_['About'] }}</h1>
<br clear="all">
<p>{{ t_['AboutDesc'] }}</p>
<br clear="all">
<br clear="all">
<blockquote>{{ t_['blockquote'] }}</blockquote>
</div>
<div class="partners-section" id="partners">
<h1>Partners</h1>
<br clear="all">
<p>Still looking for partners :(</p>
</div>
<div class="services-section" id="services">
<h1>Services</h1>
<br clear="all">
<br clear="all">
<br clear="all">
<div class="shop-cart-service">
<figure>
<img src="http://mashop.com/img/shop-cart.png" width="35%" />
<h1>Online Shopping</h1>
<figcaption>A easy way to shop with a better UI/UX for our clients</figcaption>
</figure>
</div>
<div class="daizpay-service">
<figure>
<img src="http://mashop.com/img/dayz-pay.png" width="35%" />
<h1>Daiz Payment's Gateway</h1>
<figcaption>A better way to do payments through our online shop</figcaption>
</figure>
</div>
</div>
<div class="contact-section" id="contact">
<h1>Contacts</h1>
<br clear="all">
<br clear="all">
<div class="contacts-form">
<div class="form-message"></div>
<form action="" method="POST" class="ajax">
<label for="nome" class="name-label">Name:</label><br clear="all" />
<input type="text" name="name" id="name" /><br clear="all" />
<br clear="all" />
<label for="email" class="email-label">Email:</label><br clear="all" />
<input type="email" name="email" id="email" /><br clear="all" />
<br clear="all" />
<label for="subject">Subject:</label><br clear="all" />
<input type="text" name="subject" id="subject" /><br clear="all" />
<br clear="all" />
<label for="message">Message:</label><br clear="all" />
<textarea rows="4" cols="49" name="message" id="message"></textarea><br clear="all" />
<br clear="all" />
<input type="submit" value="Send" id="submit" />
<input type="reset" value="Reset" />
</form>
</div>
</div>
And here the en-US.php which is inside of app/messages folder where I have the arrays:
<?php
$messages = array(
"AboutDesc" => "DaizGroup was thought and createad in 30th October 2016 in Braga. The CEO thought about this to give a easy way to people buy with a better gateway security.
He thought it wouldn't be worst if our company just do payments of shopping retailing with secure gateways.
Also we developed a gateway payment, easy and secure, and it works on this website. Our company sells everything from books to anything of technology. This website is also done with the heart of our own CEO and his team for our clients.",
"Do-you-shop-a-lot" => "Do you shop a lot",
"Shop-Now" => "Shop Now",
"About-Us" => "About Us",
"Partners" => "Partners",
"Services" => "Services",
"blockquote" => "Will not be possible if you don't have determination, passion, warrior spirit and never give up. Follow your dreams and wait for the right moment.",
"SadPartners" => "Still looking for partners",
"OnlineShopping" => "Online Shopping",
"DaizGateway" => "Daiz Payment's Gateway",
"OnlineShoppingDesc" => "A easy way to shop with a better UI/UX for our clients",
"DaizGatewayDesc" => "A better way to do payments through our online shop",
"Name" => "Name",
"Email" => "Email",
"Subject" => "Subject",
"Message" => "Message",
"Send" => "Send",
"Reset" => "Reset",
"About" => "About"
);
?>
Any of help would be appreciated.
Thank you.