zend-framework2

Redirect URLs with #! dynamic content

孤街浪徒 提交于 2019-12-12 05:39:26
问题 I had a temporary site made on Wix, and will soon need to move to a new one made in Zend Framework 2. For SEO reasons, not to lose the ranking gained so far, I need to 301 redirect the page URLs of the old site to pages in the new one, the problem is that Wix uses some weird addresses like www.mysite.com/#!about/etc, so the Redirect 301 rule in .htaccess doesn't work as the stuff after the # is not seen as a part of the link. How can I redirect from such URLs without losing their Google juice

ZF2 - Register custom form element

二次信任 提交于 2019-12-12 05:37:31
问题 In ZF2, I've overridden the Text element with my own (call it My\Form\Element\Text ). Now I want to make it so that when I add a text element to the form, it defaults to my overridden class and not Zend\Form\Element\Text : $this->add([ 'type' => 'text', 'name' => 'to', ]); I know that I could use 'type' => 'My\Form\Element\Text' instead of just 'type' => 'text' , but I'm trying to find out if I can avoid that and just use the custom element by default. I've tried both of these techniques:

unable to get route name from url in zend framework 2

流过昼夜 提交于 2019-12-12 05:35:55
问题 I'm using Zend Framework 2, this is my code: $prevsingletrackurl = $this->getRequest()->getHeader('Referer')->getUri(); From this code which is defined in a controller's method I'm getting previous URL, now what I need to know some information of this from this, it contains which route, controller, method for my own requirement. 回答1: You can use the route stack itself to try to match it. It will return you a RouteMatch if the request object matched: use Zend\Mvc\Router\RouteMatch; $referer =

ZF2 TableGateway join

蓝咒 提交于 2019-12-12 05:32:18
问题 I am in the process of trying to learn OO/Zend Framework over standard PHP.. I want to scream and write a mysql query instead of using the TableGateway method. I have been following tutorials and have successfully printed out a table and some fields, although with the way I have gone about doing this, I am totally lost in how I should make this a join with another table and print out some fields there. For example. Table Fields customer Idx, Company contact Idx, First_Name This is my

ZF2: Attach event to another Controller's Action and get Service Locator

我只是一个虾纸丫 提交于 2019-12-12 04:59:42
问题 I am new to Zend Framework 2. I have two modules 'A' and 'B'. I trigger an event in LoginController's LoginAction of "A" module. I want to attach LoginController's LoginAction or LoginController's testMe() method. In "A" module's LoginController's LoginAction, I have written $this->getEventManager()->trigger('checkme.post', null, array('user_id' => $userData->usydstudentid)); In Module.php of "B" module, in on Bootstrap method, I have given $loginController = new B\Controller\LoginController(

Having trouble with URI routing for modules in Zend Framework

故事扮演 提交于 2019-12-12 04:54:00
问题 I'm just starting off with Zend Framework, and I'm not quite sure what I'm doing wrong with the URI routing. I'm starting with an initial Zend Framework project in Zend Studio based in my htdocs folder (I'm using Zend Server as well on Windows 7). Everything up to there seems to be working fine getting the index page up (it's running out of the /public/ subdirectory). But when I try to add a module though, in this case called Users with a controller called Index, and following the

Network Error (tcp_error) A communication error occurred: “”

◇◆丶佛笑我妖孽 提交于 2019-12-12 04:43:55
问题 Last days, I deployed a PHP app(ZF2) on a EC2 instance(Ubuntu Server 12.04). I installed classic packages for a LAMP environment. I defined my vhost then I test my website. The website worked fine and sometimes I have the error : Network Error (tcp_error) A communication error occurred: "" I have no error. I checked Apache logs, PHP logs, etc but I found nothing why I have this error something. When I reload the page, the page works again... I would like to know if someone already got this

Zend Framework 2: How to create own User mapper for ZfcUser

筅森魡賤 提交于 2019-12-12 04:37:27
问题 I am working on my first Zend Framework 2 Project. I have implemented ZfcUser in my Project and since I have slightly different Columns in my Database Table, I want to overwrite the User Mapper from ZfcUser. I have searched through the Internet and on here, but did not get the solutions to work. I have to admit that the solution I found is from 2012 (ZF2: Custom user mapper for ZfcUser module), so maybe something has changed in the meantime. So what have I done so far. I have created my own

How can you translate this query into zend framework 2 syntax?

情到浓时终转凉″ 提交于 2019-12-12 04:36:42
问题 I haven't figure it out, how to translate this query into zend framework syntax, any help would be apreciated. SELECT p.idProyecto,p.nombre, p.nombre, e.nombre, e.apellido, sum(Respuesta.estimado) as estimado, DATE_FORMAT(p.fechaInicio, '%Y/%m/%d') as inicio, DATE_FORMAT(p.fechaFin, '%Y/%m/%d') as fin, sum(DetailTotals.Total) as total FROM Actividad as a LEFT JOIN ( SELECT a2.idActividad, sum(ar2.tiempoEstimado) as estimado FROM actividadResponsable as ar2 JOIN actividad as a2 on ar2

zend framework 2.0 fill option from database

独自空忆成欢 提交于 2019-12-12 03:48:15
问题 i have my application based in ZendSkeletonApplication , now i want create to relationship between my models so: user portal id id firstName name lastName url ........ portal_Id I want to fill my select-option in the user form with database values <?php namespace Register\Form; use Zend\Captcha\AdapterInterface as CaptchaAdapter; use Zend\Form\Form; use Zend\Form\Element; class UserForm extends Form { protected $portalTable; public function __construct($name = null) { parent::__construct(