zend-framework3

Reasons why PHP stream_socket_enable_crypto() returns FALSE?

◇◆丶佛笑我妖孽 提交于 2021-02-10 18:41:01
问题 I am setting up a ZF3 SMTP Mail transport to send messages to my own email server which I have set up using PostFix and Dovecot. I keep getting the 'Unable to connect via TLS' error which occurs when the stream_socket_enable_crypto() tries to enable TLS. I tried with another email server (my ISP's email server) using TLS and it worked so it is not my code itself. Since I have been able to connect Outlook to my email server, I know that the connection to smtp:587 to my server works and that

Reasons why PHP stream_socket_enable_crypto() returns FALSE?

你说的曾经没有我的故事 提交于 2021-02-10 18:38:44
问题 I am setting up a ZF3 SMTP Mail transport to send messages to my own email server which I have set up using PostFix and Dovecot. I keep getting the 'Unable to connect via TLS' error which occurs when the stream_socket_enable_crypto() tries to enable TLS. I tried with another email server (my ISP's email server) using TLS and it worked so it is not my code itself. Since I have been able to connect Outlook to my email server, I know that the connection to smtp:587 to my server works and that

Zend framework 3 - Translate validation message

倖福魔咒の 提交于 2021-01-29 18:32:26
问题 I need to translate validation message. I found this link https://zendframework.github.io/zend-validator/messages/ In my global config I have this 'translator' => [ 'locale' => ['it_IT','en_US'], 'translation_file_patterns' => [ [ 'type' => 'gettext', 'base_dir' => getcwd() . '/data/language', 'pattern' => '%s.mo', ], ], ], In the view translator , using __('key'), work fine. But validation message remain in english I used the site's guide to validate the form this is my code <?php namespace

Config in global.php or local.php not working but works from module.config.php in laminas api

一个人想着一个人 提交于 2020-05-17 08:49:39
问题 Config in global.php or local.php not working but works from module.config.php in laminas API. So when developer mode is enabled it works with local.php but as soon as I deploy it doesn't. But when I add the database details in module.config.php then it works. public function __invoke($services) { $db = 'Db\StatusLib'; $table = 'status'; if ($services->has('config')) { $config = $services->get('config'); switch (isset($config['statuslib'])) { case true: $config = $config['statuslib']; $db =

Form custom elements with factories

穿精又带淫゛_ 提交于 2020-03-04 23:07:31
问题 We are used to work with ZF2, but for our last project, we decided to start with ZF3. Now I am facing a problem in the form creation. What I want to do is to create a custom select populated with values retrieved from database. What I did in ZF2 was creating a class extending a select, with the ServiceLocatorAwareInterface , like: class ManufacturerSelect extends Select implements ServiceLocatorAwareInterface { public function init() { $manufacturerTable = $this->getServiceLocator()->get('Car

ZF3 Unit test authentication onBootstrap

主宰稳场 提交于 2020-03-02 04:58:35
问题 I have a problem getting a unit test to run for my IndexController class. The unit test just does the following (inspired from the unit-test tutorial of zf3): IndexControllerTest.php : public function testIndexActionCanBeAccessed() { $this->dispatch('/', 'GET'); $this->assertResponseStatusCode(200); $this->assertModuleName('main'); $this->assertControllerName(IndexController::class); // as specified in router's controller name alias $this->assertControllerClass('IndexController'); $this-

Doctrine inheritance for entities common fields

[亡魂溺海] 提交于 2020-01-15 08:28:50
问题 I'm using Zend Framework 3 and Doctrine ORM for my web project. I have several modules in my application ( User , Stock , Sales ) and some entity models on each Module: User module entities: User , Account , etc.. Stock module entities: SKU , StockLevel , etc.. Sales module entities: Invoice , PaymentMethod , etc.. By default all entities has common fields, things like: creationDateTime : Date/time of creation creationUser : User who create the entity lastChangeDateTime : Date/time of last

ServiceManager in ZF3

删除回忆录丶 提交于 2020-01-09 11:11:19
问题 I know that this has been covered extensively in other threads, but I'm struggling to work out how to replicate the effect of $this->getServiceLocator() from ZF2 controllers in ZF3 ones. I have tried creating a factory using the various other answers and tutorials that I've found here and elsewhere, but ended up in a mess with each of them, so I'm pasting my code as it was when I started in the hope that someone can point me in the right direction? From /module/Application/config/module

ServiceManager in ZF3

独自空忆成欢 提交于 2020-01-09 11:10:06
问题 I know that this has been covered extensively in other threads, but I'm struggling to work out how to replicate the effect of $this->getServiceLocator() from ZF2 controllers in ZF3 ones. I have tried creating a factory using the various other answers and tutorials that I've found here and elsewhere, but ended up in a mess with each of them, so I'm pasting my code as it was when I started in the hope that someone can point me in the right direction? From /module/Application/config/module

undefined variable company in zendframework 3

試著忘記壹切 提交于 2020-01-06 08:56:05
问题 undefined variable company undefined variable i m getting error public function addPolicyAction() { if ($this->sessionContainer->empId == "") { return $this->redirect()->toRoute('admin_user_login'); } $ouCode = $this->sessionContainer->ouCode; $langCode = $this->sessionContainer->langCode; $empId = $this->sessionContainer->empId; $arrLabel = array('company_policy','pdid','pdname','file_name','active'); $commonTransalationLabel = $this->commonTranslation->getCommonTransactionInformation(