zend-framework2

Extending Zend\\View\\Helper\\Url in Zend Framework 2

人盡茶涼 提交于 2019-12-06 03:10:34
I wrote a simple url view helper, that extends Zend\View\Helper\Url and attached it to the ViewHelperManager : MyNamespace\View\Helper\Url namespace MyNamespace\View\Helper; use Zend\View\Helper\Url as ZendUrl; class Url extends ZendUrl { public function __invoke($name = null, array $params = array(), $options = array(), $reuseMatchedParams = false) { $link = parent::__invoke($name, $params, $options, $reuseMatchedParams); ... return $link; } } Application\Module namespace Application; use ... class Module { public function onBootstrap(MvcEvent $mvcEvent) { $application = $mvcEvent-

ZF2 SOAP “Procedure not present” Error

倖福魔咒の 提交于 2019-12-06 03:02:48
问题 I'm having serious trouble to solve this issue. I got an APP with 3 modules that got different services to provide by SOAP. What happens is that 2 of them are getting this response: SoapFault File: /var/www/empreendimentos/vendor/zendframework/zendframework/library/Zend/Soap/Client.php:10 Message: Procedure not present I already double checked, and the names of the functions are right and I use the method getFunctions. This is the return from getFunctions(): array 0 => string 'Array getCliAll

doctrine migrations 2 + zend framework 2 = is it possible?

雨燕双飞 提交于 2019-12-06 02:49:20
问题 I have used this guide http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/ and now I have a working Doctrine 2 + ZF2 software. I use a versioning system and I want then use Doctrine MIGRATIONS tool to have a database migration system. If I put on a shell ./doctrine-module orm:schema-tool:update it works correctly, but if I use a migration tools for example ./doctrine-module migrations:status the system give me an error: [Doctrine\DBAL\Migrations\MigrationException]

ZF2 - \Zend\Db\Adapter\Platform::getQuoteIdentifierSymbol()

烈酒焚心 提交于 2019-12-06 02:47:49
问题 Code is as following, where I aim to use Pdo_mysql: use \Zend\Db\Adapter\Adapter; use \Zend\Db\Sql\Sql; use \Zend\Db\Sql\Expression; $params = array( 'driver' => "Pdo_mysql", 'host' => &$this->Registry->config[ 'sql' ][ 'host' ], 'username' => &$this->Registry->config[ 'sql' ][ 'user' ], 'password' => &$this->Registry->config[ 'sql' ][ 'passwd' ], 'dbname' => &$this->Registry->config[ 'sql' ][ 'dbname' ] ); $this->adapter = new \Zend\Db\Adapter\Adapter( $params ); $this->platform = $this-

Zend Framework 2 two templates in one layout?

一笑奈何 提交于 2019-12-06 02:47:16
In each module in my application I'll have a main content section and a sidebar menu. In my layout I have the following... <div id="main" class="span8 listings"> <?php echo $this->content; ?> </div> <div id="sidebar" class="span4"> <?php echo $this->sidebar; ?> </div> My controllers all return a single ViewModel which specifies the content (see below) but how do I get it to also populate the sidebar? public function detailsAction() { *some code to populate data* $params = array('data' => $data); $viewModel = new ViewModel($params); $viewModel->setTemplate('school/school/details.phtml'); return

Autocompletion for ZF2 view helpers in PhpStorm

落花浮王杯 提交于 2019-12-06 02:32:21
问题 Does anyone know if PHPStorm has some builtin support for view helper autocompletion or a possibility to write a plugin for it. I don't want to use inline var definitions for this as this would be cumbersome to do if I use a lot of view helpers $this->inlineScript()-> //I want some autocomplete here. $this->translate('some translation')-> //Please give me autocompletion If I use var definitions it will end up as something like this, but it will really clutter up my view: /* @var $inlineScript

Change Fieldset Fields' required parameter dynamically

大兔子大兔子 提交于 2019-12-06 02:08:07
问题 I have a moneyFieldset with 2 fields, amount and currency. class MoneyFieldset ... { public function __construct($name = null, $options = array()) { parent::__construct($name, $options); $this->setHydrator(...); $this->add(array( 'name' => 'currency', 'type' => 'select', 'options' => array( 'value_options' => \Core\Service\Money::getAvailableCurrencies(true), ), 'attributes' => array( 'value' => \Core\Service\Money::DEFAULT_CURRENCY, ), )); $this->add(array( 'name' => 'amount', 'type' =>

Doctrine Inheritance replacement

回眸只為那壹抹淺笑 提交于 2019-12-06 02:03:49
问题 Currenty we're developing a very flexible and modular application with Zend Framework 2 and Doctrine 2. In this application there are multiple Doctrine entities, for example let's say the entity Product in the module Products . This module Products is the base/default module for product management. We want to be able to create a custom Products module for a customer ( XProducts ). Therefore I created a new entity, XProduct (with some extra fields) which extends Product . So if the custom

Translation of database with poedit and zend translate

你离开我真会死。 提交于 2019-12-06 01:33:57
Poedit does not automatically recognise the content of a table in a database. What is the best way to get the content of a table recognized by poedit for its translation in zend. I would like it to be done automatically....do I have to create an xml file from the database ? You should not translate database contents with poedit. You would do that inside the database. The short answer: what you want cannot be achieved, unfortunately. You can translate "fixed" strings and if you want to get variables, constant or database values translated, you have to do that via literal string translations, in

ZF2: Active branch for child routes in zend navigation. How?

折月煮酒 提交于 2019-12-06 01:28:24
I have this as route configuration in Zend Framework 2: 'news' => array( 'type' => 'Literal', 'options' => array( 'route' => '/news', 'defaults' => array( '__NAMESPACE__' => __NAMESPACE__ . '\Controller', 'controller' => 'News', 'action' => 'index', 'page' => 1, ), ), 'may_terminate' => true, 'child_routes' => array( 'index' => array( 'type' => 'Segment', 'options' => array( 'route' => '[/:page]', 'constraints' => array( 'page' => '\d+', ), 'defaults' => array( '__NAMESPACE__' => __NAMESPACE__ . '\Controller', 'controller' => 'News', 'action' => 'index', 'page' => 1, ), ), ), ), ), I also have