zend-framework2

zend framework 2 composer.php

我的梦境 提交于 2019-12-25 12:37:33
问题 when I try to install webino-image-thumb using zend php composer it gave me this error php composer.phar require webino/webino-image-thumb:2.*<br/> ./composer.json has been updated<br/> Loading composer repositories with package information<br/> Ignoring unknown parameter "server role"<br/> Updating dependencies (including require-dev)<br/> Your requirements could not be resolved to an installable set of packages.<br/><br/> Problem 1<br/> - Can only install one of: zf-commons/zfc-admin[v0.1.0

Rename nama in upload ZF2 + AWS S3

六眼飞鱼酱① 提交于 2019-12-25 11:01:13
问题 How can I rename the name of a file before to upload zf2 and Amazon S3? This is my code: $files = $request->getFiles(); $bucketname = 'mybucket'; $result = $aws->putObject(array( 'Bucket' => $bucketname, 'Key' => 'user/5/'.$files['image-file']['name'], 'Body' => EntityBody::factory(fopen($files['image-file']['tmp_name'], 'r')), 'ACL' => CannedAcl::PUBLIC_READ, 'ContentType' => 'image/jpeg' )); I can not use the module https://github.com/aws/aws-sdk-php-zf2 回答1: This is a working example t

Zend2, Zfcuser - automatic logout

柔情痞子 提交于 2019-12-25 10:57:08
问题 I'm working with Zend Framework 2, ZfcUser and BjyAuthorize. Logging in and access control works, but under certain circumstances users get logged out: When they try to navigate to a different page while an on the current page an AJAX call is still running. In Chrome's Network window it shows the AJAX call as cancelled, followed by a call to the page you tried to navigate to, where the following code checks if you're logged in, finds that you're not ( $auth->hasIdentity() returns false ), and

Using ZF2, create a WITH statement?

喜欢而已 提交于 2019-12-25 10:21:27
问题 How do I create this SQL using ZF2? WITH q AS ( SELECT m.*, CAST(ROW_NUMBER() OVER (ORDER BY m.PersonId) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN AS bc FROM mytable m WHERE ParentID IS NULL UNION ALL SELECT m.*, q.bc + '.' + CAST(ROW_NUMBER() OVER (PARTITION BY m.ParentID ORDER BY m.PersonID) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN FROM mytable m JOIN q ON m.parentID = q.PersonID ) SELECT * FROM q ORDER BY bc From: https://stackoverflow.com/a/1757302/351785 Starting in a model, I can

Using ZF2, create a WITH statement?

自作多情 提交于 2019-12-25 10:21:12
问题 How do I create this SQL using ZF2? WITH q AS ( SELECT m.*, CAST(ROW_NUMBER() OVER (ORDER BY m.PersonId) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN AS bc FROM mytable m WHERE ParentID IS NULL UNION ALL SELECT m.*, q.bc + '.' + CAST(ROW_NUMBER() OVER (PARTITION BY m.ParentID ORDER BY m.PersonID) AS VARCHAR(MAX)) COLLATE Latin1_General_BIN FROM mytable m JOIN q ON m.parentID = q.PersonID ) SELECT * FROM q ORDER BY bc From: https://stackoverflow.com/a/1757302/351785 Starting in a model, I can

How can I buffer an unbuffered ResultSet in ZF2 zend-db?

时间秒杀一切 提交于 2019-12-25 09:16:46
问题 My Atlas class performs a recursive data exploration given a non-contiguous but sequential set of col1 values, read from MySQL table1 beginning with $startingVal . Limit $totalVal is a throttle for work units during any given session. On each recursion, Atlas will retrieve between zero and eight (0-8) rows from a different table. Fatal error: Uncaught exception 'Zend\Db\Adapter\Exception\RuntimeException' with message 'Row count is not available in unbuffered result sets.' in /path/vendor

ZF2 ACL check link in view

痞子三分冷 提交于 2019-12-25 08:58:51
问题 I have set up my roles, resources and permissions in my bootstrap, and in my layout have set up a navigation menu based on this, and this works. What I am attempting to do now is create an admin panel with edit / delete links IF the current logged in user has those permissions. e.g. I may have multiple roles that can view a list of cms pages, but only certain roles can edit a cms page, and only certain roles can delete a cms page. At the moment I am just checking if the user is logged in: <

In Zend Framework 2 navigation how can I render HTML content in label?

╄→尐↘猪︶ㄣ 提交于 2019-12-25 08:48:30
问题 Zend navigation escapes my label content. Here is my code; // config 'navigation' => array( 'default' => array( array( 'label' => 'Home', 'route' => 'home', ), array( 'label' => '<i class="fa fa-database"></i> Assets', 'route' => 'assets', 'pages' => array( array( 'label' => 'Browse', 'route' => 'assets/default', 'controller' => 'index', 'action' => 'index', ), array( 'label' => 'Detail', 'route' => 'assets/default', 'controller' => 'index', 'action' => 'host', ), ), ), ), ), // in view

ZF2 injecting InputFilter into Fieldset not working automatically

不羁的心 提交于 2019-12-25 07:58:49
问题 I'm building a small application with ZF2 and Doctrine2. Setting it up in such a way as to have a lot of reusable code and technique. However, getting stumped by the fact that my InputFilter is not automatically injected into the Fieldset that it should get associated to. I've confirmed that the Form that uses the Fieldset works (without the InputFilter ). The InputFilter is also visible as present during debugging. The question then, what am I doing wrong and how to fix having a separate

How to get the current module/controller/action from a view script in Zend Framework 2?

淺唱寂寞╮ 提交于 2019-12-25 07:51:35
问题 Is it possible to get the current module/controller/action name from a view script? How can I do it? 回答1: You could retrieve it in your controller using the MvcEvent object and then assign it to the ViewModel so you can retrieve it in the view: public function indexAction() { return new ViewModel( array( 'controller' => $this->getEvent()->getRouteMatch()->getParam('controller'), 'action' => $this->getEvent()->getRouteMatch()->getParam('action') ) ); } The module name is a bit trickier, but