1. Go to this page and download the library: Download atans/atans-common library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function indexAction()
{
$id = (int) $this->params()->formRoute('id', 0);
// Default object manager is doctrine.entitymanager.orm_default
$entity = $this->objectManager()->find('Application/Entity/EntityName', $id);
// or
$entity = $this->objectManager('doctrine.entitymanager.orm_other')->find('Application/Entity/EntityName', $id);
}
public function indexAction()
{
$message = $this->translate('This is a message');
// Same as
$translator = $this->getServiceLocator()->get('Translate');
$message = $translator->translate('This is a message');
}
echo \AtansCommon\Text\String::cut('This is a longer text', 6);
// output : This i...
public function indexAction()
{
$this->flashMessenger()
->setNamespace('application-index')
->addSuccessMessage('Message text');
...
return array();
}