Menu
  • HOME
  • TAGS

Zend Framework 2 - Sending form using Zend\Mail

php,jquery,ajax,zend-framework,sendmail

While I was implementing my email method I was never able to get the exception with: catch (\Exception $e) { return false;} For me it was not so important to get it though. But at some point I noticed that I was getting an exception when the domain did not...

Zend_Db - How to use results from Zend_Db_Table_Select

php,zend-framework

You can use fetchAll to get the name or the css path Try below code. public function authAction() { $shop= new BS_Model_Subshops(); $id= filter_var($this->getRequest()->getPost('id')); $db_content = $shop->select()->where('id= '.$id); $result = $db_content->query()->fetchAll(); foreach($result as $key=>$value){ echo "Name : ". $value->name; echo "</br>"; echo "Css Path : ". $value->css_path; } Zend_Debug::dump($db_content); ......

zend frmawork 1 set variable value of view in plugin

zend-framework,plugins

If I'm not mistaken, the view is already formed in the method postDispatch() plugin. You can add this method in your AController controller. Obviously, your AController controller already extend another controller Model_BaseController. So you can add this method in your controller Model_BaseController like this: class Model_BaseController extends Zend_Controller_Action { ......

How to get the column names of table in a database in zend?

php,mysql,zend-framework

You can retrieve information from Zend_Db_Table_Abstract. Create a new class like this: class foo extends Zend_Db_Table_Abstract { } In your code: foreach($ExternalDb->listTables() as $table){ $dbTable = new foo($ExternalDb); $dbTable->setOptions(array($dbTable::NAME => $table)); var_dump($dbTable->info($dbTable::COLS)); unset($dbTable); } ...

How to get video commented users profile Details using Zend Gdata YouTube?

php,zend-framework,youtube

Find from this way, $yt = new Zend_Gdata_YouTube(); $commentFeed = $yt->getVideoCommentFeed($video_id); foreach ($commentFeed as $commentEntry) { $feedURL = $commentEntry->author[0]->uri->text; $xmlReader = new XMLReader(); $xmlReader->open(feedURL); while($xmlReader->read()) { // check to ensure nodeType is an Element not attribute or #Text $thumbnail=$xmlReader->getAttributeNs('thumbnail','media'); if($xmlReader->nodeType == XMLReader::ELEMENT) { if($xmlReader->localName == 'thumbnail') { $photoUrl =...

zend 1 xsd validation

xml,zend-framework,xsd-validation

No, it does not provide anything, but there is no reason as you can use PHP's DomDocument class to perform this validation and it is a very simple task: $dom= new \DomDocument(); $dom->loadXML($xmlContent); $dom->schemaValidate('xsd/schema.xsd'); I would use this code to build a custom validator, so it's easy to reuse: http://framework.zend.com/manual/1.12/en/zend.validate.writing_validators.html...

Object of class Zend_Db_Table_Row could not be converted to string

php,mysql,zend-framework

The error message is telling you what the problem is. fetchRow() is returning a Zend_Db_Table_Row object which you are then storing in an array in the index 'weekpages'. I'm not sure what you intend to do with the data from the retrieved row but you can try either converting the...

How to add special span to addDisplayGroup fieldset

php,html,zend-framework,zend-form

Another way is to use javascript like this: var attr_fieldset = ""; var num_fielset = 0; var elt_fieldset = null; // get all fieldsets var list_fieldset = document.getElementsByClassName('fieldset_group'); for (var i = 0; i < list_fieldset.length; i++) { // to get one fieldset elt_fieldset = list_fieldset[i]; // to get $i...

Cell width = text width FPDF

php,pdf,zend-framework,export,fpdf

Do you want FPDF::GetStringWidth? http://www.fpdf.org/en/doc/getstringwidth.htm...

How to make zend to set time_zone in sql

php,mysql,zend-framework

You should separate the two queries. The Zend_Db objects aren't retrieving any results if you first use mysql SET command, or execute two queries at once First use: $this->_db->query('set time_zone='+8:00';'); Then, on a second line: $Query = $this->_db->query('SELECT n.id FROM ...') And then you can fetch results or loop through...

Zend InputFilter requires intl PHP extension?

php,zend-framework,zend-framework2

Fixed it by going to php.ini and uncommenting extension=php_intl.dll

PHP-DI is not working in integration with ZendFramework2

php,zend-framework,zend-framework2,php-di

For a service: factory config: 'factories' => array( 'MyService' => 'Application\Factory\MyService', ), Factory class: class MyService implements FactoryInterface { public function createService(ServiceLocatorInterface $serviceManager) { $purifier = new MyService($serviceManager->get('MyAwesomeDependency')); return $purifier; } } For a controller: ControllerFactory.php: class PartOfSpeechControllerFactory { public function __invoke($serviceLocator) { // Service locator here is the ControllerManager...

codeigniter not working after installing zend Framework

php,codeigniter,zend-framework,ubuntu-14.04

It's about your apache configuration ( i assume you use apache cause it's in digital ocean documentation ) <VirtualHost *:80> ServerName localhost DocumentRoot /var/www/ZendApp/public with this configuration, your localhost domain is only working for your zend project. Change it's ServerName to another domain and add it to your /etc/hosts file...

How to send field name for required true validation in zend

php,zend-framework,zend-form,zend-validate

Try this:- $this->addElement( 'text', 'title', array( 'placeholder' => 'Title', 'class' => 'form-control', 'required' => true, 'filters' => array( 'StringTrim' ), 'autocomplete' => 'off', 'validators' => array( array('NotEmpty', false, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Title is required and cant be empty'))) ) ) ); ...

How to route pages using text instead of IDs?

zend-framework,zend-framework2,zend-route,zend-router

There are a couple of ways. Without your code it will be pretty difficult to explain, but i'll give it a shot. First, there is one way you could solve it is by storing your news with an attribute called friendlyUrl (for example) and instead of selecting your news by...

ZF2 - update user profile page

php,authentication,zend-framework,zend-framework2

After your update has been successful: $authenticationService->getStorage()->write($newIdentity); Now you've updated your identity to match, however, I'd be very careful about a system that can dynamically shift identity. Identity should hopefully be unique and persistent. Not to say you CAN'T do it, but make sure you've covered your bases so no...

controller action not found on production server

php,zend-framework

since your are using zend framework why don't you use the Zend_Date $dateObj = new Zend_Date(); $dateObj->set($form->getValue('datum'),'dd/MM/yyyy'); $datum = $dateObj->toString('yyyy-MM-dd'); ...

How to create Log File on hourly basis in Zend Framework 1.1

php,apache,zend-framework,logging,logfile

Try this, In this case, a new file will be created each second. <param name="datePattern" value="Y-m-d.H.i.s" /> In this case, a new file will be created each hour. <param name="datePattern" value="Y-m-d.H" /> ...

ZendX Console Process posix functions

zend-framework,zendx

I am installed the php-process package. In Red Hat, or Centos, to use: sudo yum install php-process -y ...

Transfert a Zend Project to Symfony

php,symfony2,zend-framework

There is no way* I can think of that would allow you to automatically transfer a project from Zend Framework 1 to Symfony2. You would have to start all over again, from scratch. My boss made me do that, there was this app written in C, Python, Perl, Bash and...

FPDF cell text doesn't fit

php,zend-framework,fpdf

$pdf=new PDF_MC_Table(); $pdf->Open(); $pdf->AddPage(); $pdf->SetWidths(array(10, 15, 12, 14,25,17,35,15,15,20)); srand(microtime()*1000000); $o=1; foreach ($finalData as $row) { if ($o == 1) { $pdf->SetFont("Arial", "B", "8"); } elseif($o<>1) { $pdf->SetFont("Arial", "", "7"); } $pdf->Row( $row); $o++; } $pdf->Output(); That's it! A beautifull table :)...

How to use helper classes in zf2?

zend-framework,zend-framework2

You can create a directory called Plugin under the Controller directory. A good name for your plugin will have the 'Plugin' termination. If your plugin will only have one method you can put your logic in the __invoke method: public function __invoke($data) { // [ process $data ] } If...

Get the cid for Google Analytics in PHP/Zend Framework

php,zend-framework,google-analytics,measurement-protocol

All of the parameters sent directly through the Measurement protocol must be created by you. Client ID / Cid This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly...

Zend Framework 2 Cache filesystem

php,zend-framework,zend-framework2

Here is a useful link to the official ZF2 documentation for the specific StorageAdapter that you are using (filesystem).

Storing objects in an array and retrieving - PHP

php,oop,symfony2,zend-framework

You answered it yourself perfectly. You're overwriting $graph with each iteration of your loop, with a completely new instance of a Graph object. First, remove your constructor to allow you to create an instance of Graph without first needing an Edge instance (ie, outside your loop), then use your already...

How to make item selected in dropdown list

php,zend-framework,default

Seeing your code, I guess you're in a controller. To create a select element, you should do this: $s_t = array( "key1" => "value1", "key2" => 'value2', "key3" => 'value3'); $form->addElement('select','name'); $form->getElement('name')->setLabel('Choose your option:') ->addMultiOptions($s_t); Or with a single instruction: $form->addElement('select','name', array('label'=>'Choose your option:', 'MultiOptions' => $s_t)); It's the same...

Pass array on url using zend framework 2 routes

php,zend-framework,routes,zend-framework2

Since I had no feedback I had to make a workaround. Here's how I managed to accomplish what I asked: First, instead of using: www.example.com/Search/Attribute1-X-Attribute3-Y/Search/Attribute2-Z I used something like this: www.example.com/Search/Attribute1/X/Attribute3/Y/Search/Attribute2/Z I first used a regex to this route on my module.config: 'search' => array( 'type' => 'Application\Router\SearchesImprovedRegex', 'options' =>...

Failed installation of zend-escaper with Composer

php,zend-framework,composer-php

The PHP version on the command line can be a different executable than the PHP running inside the web server. It also can use a different pho.ini configuration file. So if Composer states the PHP it is using is 5.3.5, this is correct because Composer is directly asking the PHP...

Zend rpc json return array

php,arrays,json,zend-framework,zend-framework2

In your action you must return a JsonModel. To do that, first create a 'strategies' key under your 'view_manager' section in your module.config.php: 'view_manager' => array( 'strategies' => array( 'ViewJsonStrategy', ), ), Now you can return a JsonModel in your action: $data = array(1, 2, 3, 4, 5); return new...

Validation for Add screen not working but it working in edit screen with same code

php,validation,zend-framework,zend-form

You need to change following code in the addAction logic: instead of: $this->populate($formData); use $form->populate($formData); The reason is $this means Action object in this context and you have correctly used $form object in EditAction so it is working properly, so it is kind of silly typing mistake. PS: you should...

Create dynamic input name with Zend Form

php,forms,zend-framework,zend-form

In your controller, I guess you have something like this to get POST variables: if ($this->getRequest()->isPost()) { $formData = $this->getRequest()->getPost(); if ($form->isValid($formData)) { .... So you can test each POST variable, if it matches than 'email' and not equals to 'email', you can create a new email variable POST if...

Get Google Plus Images Using Zend Framework 1 Gdata

php,cakephp,zend-framework,google-plus,gdata

Zend_Gdata uses ClientLogin which was deprecated as of April 20, 2012 and turned off on May 26 2015. This code will not longer work you need to switch to using Oauth2. You can use the current Google PHP client library to authenticate then use the access token created there to...

Manipulate value in Zend_Registry

php,zend-framework

It has been a long while since I have manipulated the registry as you have asked, however I think you can do the following: $myArray = Zend_Registry::get('myArray'); $myArray['key'] = $value; Zend_Registry::set('myArray', $myArray); This gets the value out of Zend_Registry, adds another element to the array, and sets it back into...

Zend framework - how can i update the row if status field and id match?

php,zend-framework

For your comparison you can't use an array for the where part of the statement. Instead you should use the Where class. Add at the top of the .php file the following: use Zend\Db\Sql\Where; Then where you use now the array you should use the Where instance: $where = new...

How to properly terminate or throw from index.php

php,exception,zend-framework

You could try wrapping your application execution in a try {} catch {} block: try { $application->bootstrap()->run(); } catch (\Exception $e) { error_log($e->getMessage(), $e->getCode()); throw $e; } This way you'll catch all exceptions, log them to your PHP error log and still see the exception being thrown. As you can...

zend framework 2 nested module structrue in one main module

php,zend-framework,zend-framework2

Your autoloader probably can't find your controller because it's under a different namespace. Try specifying the Login namespace and see if it helps. 'Zend\Loader\StandardAutoloader' => array( 'namespaces' => array( __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 'Login' => __DIR__ . '/src/Login', ), ), ...

Trigger Zend FlashMessenger in jQuery

php,jquery,ajax,zend-framework

The trick to your answer lies at your view scripts (*.phtml files). I am assuming the following index.phtml file as a view script of your indexController file that prints the form and execute your Ajax. When you click the button 'Get External Content', the result of the Ajax response from...

Uninstalling php 5.3 in ubuntu 14.04

php,zend-framework,ubuntu-14.04

The below answer credit goes to Maythux To uninstall something you installed from source, you would use cd back into the directory you built it from and then run sudo make uninstall but I don't think this will work with PHP since it doesn't have an uninstall. So what you...

How to get a $_POST request from view module?

php,html,forms,zend-framework,zend-framework2

From the code in your pastebin link, you have two forms on the page. One starts on line 16, contains your user checkboxes, and then ends on line 61. Then the second starts on line 77 and ends on line 79. I'm guessing this the one being submitted by the...

Zend framework 2 PHP requirement

php,zend-framework,zend-framework2

Yes, of course you can run the current release version of ZF on the current release version of PHP. The requirements page you linked to is for ZF 1.x. When the FAQ says 'add support for PHP 5.4' it means adding support for features which are only available in 5.4...

Php Class not Found (Zend)

php,class,zend-framework

Have you required those class in you Tournament.php ? You can do it with the use command. Moreover I suggest not using the scope operator :: only to call 1 method, we usually do that when we want to call a parent::method. You should instantiate de class and then call...

ZF2 - Display image in view based on full path

php,image,zend-framework,zend-framework2

I have created a module HtImgModule for doing image manipulation in Zend Framework 2. Here is an example to simply output an image: namespace Applicaton\Controller; use Zend\Mvc\Controller\AbstractActionController; use HtImgModule\View\Model\ImageModel; class MyController extends AbstractActionController { public function displayImageAction() { return new ImageModel('path/to/image'); } } So, it is not absolutely necessary to...

Laravel, Codeigniter or Zend? [closed]

java,codeigniter,laravel,zend-framework

try laravel first as it is modern and has a lot of support. Go on the irc channel and it is a great place. zend will take a lot longer to build and plan. if you want a proof of concept, you can get it up in a few days...

File upload form validation invalid

php,zend-framework

If somebody is interested and may be has the same problem, I finally got the solution: Solution 1: The problem was, that the submitted $_FILES was limited to 20 file upload fields. See php ini max_file_uploads -> http://php.net/manual/en/ini.core.php#ini.max-file-uploads. And that was why Zend always said that the form is not...

PHP - how to send png or jpg email attachment?

php,zend-framework

Use the official reference from Mandrill: API reference.

Zend 1 3d party NameSpaces autoload don't working

php,zend-framework,amazon-web-services,namespaces,autoloader

In order to use $autoloader->registerNamespace('Aws'), the AWS lib you seek must be on your PHP include path, which probably includes your ./library directory. Instead, you have the AWS lib buried down in ./library/Eplan/AmazonCloudSearch, which almost certainly is not on your PHP include_path. Try moving the AWS library up two levels,...

Working with prefixes and Zend_Controller_Router_Route

php,zend-framework,zend-route

Ok I found a solution : I changed the URL Helper to add the controller constraint inside it. If the controller doesn't match the "product lines controllers" array, it force assemble to use the default route (not perfect, but it works for me): public function url(array $urlOptions = array(), $name...

PHP ZF2 Mysql has gone away

php,mysql,zend-framework,zend-framework2

Yes, I check the persistent connection option, but I also not fond of it. I find the problem, it cause by mysql server close idle connection after 'wait timeout'. when mysql closing the idle connection, PDO will not receive any event so the next time you initiate a query it...

How to manage Zend session save handler using Zend?

php,zend-framework,memcached,zend-session,libmemcached

I found a solution to manage sessions for sub domains. What I did is I placed below three lines in .htaccess file to manage sessions on Memcache rather than files based sessions. That means no need to make changes in php.ini file. Memcache option php_value session.cookie_domain "{your_domain}" php_value session.save_handler "memcache"...

using decorators with file element

php,zend-framework,zend-form

The File element requires it's own decorator - Zend_Form_Decorator_File. Change ViewHelper for File: $logo->setDecorators( array( 'File', 'Description', 'Errors', array(array('data'=>'HtmlTag'), array('tag' => 'td', 'colspan'=>'2','align'=>'center')), array(array('row'=>'HtmlTag'),array('tag'=>'tr')) //, 'closeOnly'=>'true' ) ); ...

How to check if string exists in table which is added using addslashes?

php,mysql,zend-framework

Zend_Db_Select has a nice fluent interface to it. First thing you need to do is use its prepared statements a bit better: $sql = $this->_db->select() ->from('titles', array('name')) ->where('name = ?', $name) ->where('created_by = ?', $created_by) ->where('app_id = ?', $app_id); This will help with the SQL injection issue. Because Zend_Db uses...

Doctrine2: Lazy loading fails and I have to re-initialize the class

php,zend-framework,doctrine2

The code was called in loop like below: foreach( ... ) { $wall_post_obj->getAlbum() } But accidentally $em->clear() was placed at the end of the loop. $em->clear() clears the data from your current object. so $em->refresh() will not work....

Throwing exceptions in pimcore

php,zend-framework,pimcore

There are only a couple of pimcore-specific exceptions (take a look at pimcore/config/autoload-classmap.php): Pimcore\Tool\RestClient\Exception Pimcore\Image\Matrixcode\Renderer\Exception Pimcore\Image\Matrixcode\Qrcode\Exception Pimcore\Image\Matrixcode\Exception Pimcore\API\Plugin\Exception For common use cases stick to the Zend exceptions, using plain PHP exceptions (and/or define your onw) where none seem appropriate....

Zendframework(1.12.11) view helper not found in phpunit

zend-framework,phpunit

I got solution. I have replace my configuration setting of application.ini resources.view.helperPath = APPLICATION_PATH "/views/helpers" with resources.view.helperPath.Application_View_Helper = APPLICATION_PATH "/views/helpers/" and changed naming convention of Test.php with class Application_View_Helper_Test extends Zend_View_Helper_Abstract {} now zend loder will try to find view helper in application directory rather than Zend...

Zend Skeleton Application album tutorial 404

php,zend-framework,zend-framework2

It turns out in module.config.php I had split the array with the controllers and router into two arrays by mistake. Combining them into one seems to have solved this particular issue. Code follows: return array( 'controllers' => array( 'invokables' => array( 'Album\Controller\Album' => 'Album\Controller\AlbumController', ), ), 'router' => array( 'routes'...

Wrong datatype for referenced entity on Doctrine ObjectSelect

php,zend-framework,orm,doctrine2

What are your hydrator settings on this fieldset? For example; $this->setHydrator(new DoctrineHydrator($em, 'Blog\Entity\Category')) ->setObject( new Category() ); ...

DB connection issue when trying to connect with Zend Framework Abstract.php No Such File Or Directory

php,mysql,sockets,zend-framework,mamp

I found the solution to this. I was using the standard PHP that comes with OSX by default. I needed to change the command to use the PHP binary that comes installed with MAMP, e.g. /Applications/MAMP/bin/php/php5.6.2/bin/php vendor/ruckusing/ruckusing-migrations/ruckus.php db:migrate ENV=development Hope this helps someone. Thanks to @tunder ;)...

Fetch the maximum value of a field having same id in php

php,mysql,zend-framework,zend-framework2,zend-db-table

->join(array('oid' => DB_TABLE_PREFIX . 'order_installment_details'), 'oid.OrderInstallmentId = oi.OrderInstallmentId', array( 'OrderInstallmentDetailsId', 'lastInstallmentDate' => new Zend_Db_Expr('MAX(InstallmentDate)') )) ->join(array('f' => DB_TABLE_PREFIX . 'firm'), 'f.FirmId = c.FirmId', array('FirmName')) ->join(array('u' => DB_TABLE_PREFIX . 'user'), 'u.UserId = c.CustomerId', array('FirstName', 'LastName')) ->group('a.AccountId') ->order('j.CreatedDate ASC'); ...

Set APPLICATION_ENV in Zend Framework 1.12

zend-framework

Ok. As it seems there are different approaches how to set the APPLICATION_ENV constant in ZF1. I decided to set the constant in the .htaccess file. (If you create a new Zend project with the Zend_Tools you will see that by default a .htaccess file will be created inside the...

Php Mysql select query not working

php,mysql,zend-framework,zend-framework2

AccountId put like finance_account.AccountId or ac.AccountId because query ambiguous on which table to look at $select = $this->select() ->from(array('finance_account' => DB_TABLE_PREFIX . 'finance_account'), array( 'AccountId', 'ParentAccountId', 'AccountGroupId', 'AccountPath', 'AccountCode', 'AccountName', 'Description' )) ->joinLeft(array('ac' => DB_TABLE_PREFIX . 'customer'), 'finance_account.AccountId = ac.AccountId', array()) // using "array_unique()" to minimize db overhead ->where('ac.AccountId IN...

Static route for a subdomain in pimcore

php,zend-framework,routing,pimcore

If you work with "Sites", you can specify the site to use/apply for a static route (column "Site" in the static routes table view). More on using sites: https://www.pimcore.org/wiki/pages/viewpage.action?pageId=14551657...

Understanding bootstrap, config.php, application.ini

php,zend-framework

Well, bootstrap extends Zend_Application_Bootstrap_Bootstrap and gives you the opportunity to add in any functionality you might need for the application during its startup phase (e.g. registering plugins etc). config.php and application.ini are essentially the same thing, just different formats. You could also do config.xml if you prefer. application.ini is the...

Socialengine addon Advanced Events Plugin v4.8.8p2 throwing errror on create

php,zend-framework,socialengine

Its seems you need to verify license .Contact the Socialengineaddson guys will help you.

ZF Error ZF tool setup

zend-framework,command-line-interface

I ended up using Zend Framework 1 final release - version 1.12.11 to get around this headache and it worked perfectlt as it should have. Had to be a bug in the 1.9 version!

JQuery :toggle images

php,jquery,zend-framework

You can use $(".server_Toggle").click(function () { $("#hidden_server").slideToggle(1000); $(this).find('img').attr('src', function(i, src){ return src == 'images/open.png' ? 'images/close1.gif' : 'images/open.png'; }); }); ...

Error in Array comparison in php

php,arrays,zend-framework,foreach,zend-framework2

Solved it,simply by using (($csvRow[$this->_csvColumnJournalDate]) == $csv_ied_journal_date) ) instead of (($csvRow[$this->_csvColumnJournalDate]) === $csv_ied_journal_date) ) now works like a charm! == for same value === same data type type and value...

Overriding ZF2 global/local config: unsetting

zend-framework,zend-framework2

You can add a listener on the event Zend\ModuleManager\ModuleEvent::EVENT_MERGE_CONFIG to remove the required options. Zend\ModuleManager\Listener\ConfigListener triggers a special event, Zend\ModuleManager\ModuleEvent::EVENT_MERGE_CONFIG, after merging all configuration, but prior to it being passed to the ServiceManager. By listening to this event, you can inspect the merged configuration and manipulate it. Such a listener...

How to get all available languages from Localized Fields in pimcore?

php,zend-framework,zend-locale,pimcore

After crawling through tons of pimcore-backend-Classes I found the solution here: $config = \Zend_Registry::get("pimcore_config_system"); $validLanguages = strval($config->general->validLanguages); ...

Content type-error when using Zend_Http_Client

php,post,zend-framework,zend-http-client

This answer brought me back on track: http://stackoverflow.com/a/7407491/3218828 $rawData = ''; foreach ($postParams as $postParam => $postValue) { if ($rawData !== '') { $rawData .= '&'; } $rawData .= $postParam . '%5B%5D=' . $postValue; } $client = new Zend_Http_Client(); $client->setRawData($rawData); $client->setUri('https://ssl.google-analytics.com/debug/collect'); $client->request(Zend_Http_Client::GET); ...

Convert SQL query to Zend DB Select [closed]

php,mysql,zend-framework

Try below one $subselect = $this->db->select() ->from(array('t2' => 'fueling'), array( 'maxdate' => 'MAX(t2.date)', 'station' => 't2.station', 'ftype' => 't2.ftype', )); $select = $this->db->select() ->from(array('t1' => 'fueling'), array( 'date' => 't1.date', 'station' => 't1.station', 'ftype' => 't1.ftype', 'price'=>'t1.price', 'currency'=>'t1.currency' )) ->JOIN(array('t3'=>$subselect),'t1.date=t3.maxdate and t1.station=t3.station and t1.ftype=t3.ftype') ->Where('t1.station IN...

HTTP response returning status 0 when adding filemimetype validator to Zf2 form

php,validation,zend-framework,zend-framework2,mime-types

we had similar issues with uploading files and mime type checking on OS X. Setting the following options to the mime type validator: ->attachByName( 'filemimetype', [ // this is optional and not necessary, falls back to HTTP informations of uploaded file if mime type cannot be resolved // 'enableHeaderCheck' =>...

Use AJAX with Zend Framework 2

jquery,ajax,zend-framework,zend-framework2

If I correctly understood your question, you need to update a select value depending on the change of another value. So just bind onchange function to the select which change, get the selected value and send it via ajax to your controller action so that you could get the new...

Bootstrap of Zend Module is not loading

php,zend-framework,autoload

I did some tests in my basic ZF1 setup and the only way this does not work is when the filename is not Bootstrap.php. In terms of Linux it is also case sensitive. As you mention correctly the modules path is looked at every time and exit() is working in...

Zend date validator fail for format dd-mm-yyyy

php,validation,date,zend-framework

There is a bug in ZF-7583: Zend_Date::isDate accepts invalid dates. Thats why some dates are showing in correct. Its better to use a regex validation for it. You can check this post for the regex Regex to validate date format dd/mm/yyyy...

Zend And YouTube Not Deleting Videos

zend-framework,youtube-api,google-client-login

Zend_Gdata uses ClientLogin which was deprecated as of April 20, 2012 and turned off on May 26 2015. This code will not longer work you need to switch to using Oauth2. You can use the current Google PHP client library to authenticate then use the access token created there to...

ZF2 directory structure for lots of applications

php,zend-framework,zend-framework2,directory,structure

You definitely want to do it the first way, with each of your applications in its own module. This configuration gives you the opportunity to develop each application separately while still allowing you to share resources between them. It's also a lot easier to install, maintain and upgrade a single...

Zend paginator with AJAX

jquery,ajax,zend-framework,pagination

It depends how your front-end is built but you are on the right track. Zend1 provided a nice helper called a context switch that does most of the work for you (disables view, sets appropriate headers) but it's not necessary to use it. The general idea is to keep that...

Zend Frame Work Cron Error

php,zend-framework,cron,zend-framework2

Needed to step back one more level. 'console' => array( 'router' => array( 'routes' => array( 'sendReminder' => array( 'options' => array( 'route' => 'sendReminder', 'defaults' => array( 'controller' => 'Cron\Controller\CronController', 'action' => 'sendReminder' ), ) ), 'sendRecap' => array( 'options' => array( 'route' => 'sendDailyRecap', 'defaults' => array( 'controller'...

Different login states when using www vs no www

php,zend-framework,zend-framework2,zfcuser

If you want to use www only, in your .htaccess, include this code: RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] and vice versa for using without. Its always recommend to use just one for SEO reasons and in your case CMS's, I went...

Facebook share button shows thumbnail only after refresh. ZendFramework

php,facebook,facebook-graph-api,zend-framework

You can either trigger a first scrape via API when you publish a new piece of content, or specify the image dimensions via OG meta tags as well. https://developers.facebook.com/docs/sharing/best-practices#precaching: There are two ways to avoid this and have images render on the first Like or Share action: Pre-cache the image...

Zend Framework 2 routing error: resolves to invalid controller class or alias

zend-framework,routing,zend-framework2,zend-framework-mvc,zend-framework-routing

At the moment the route named application (the parent) defines a URL route of /application. The child route default however requires the controller name to be passed in as the first argument, followed by action. This means the URL would be /application/[:controller]/[:action] So visting /application/test You are inadvertently trying to...

Zend_Pdf how to reduce the loading time of images?

zend-framework,zend-pdf

If your images contain transparent backgrounds, they will take a long time to render in Zend_Pdf. Try removing the transparent backgrounds (if possible) and see if that makes a difference. If that helps, you could use GD library or ImageMagick to replace transaparent backgrounds with white backgrounds as the logos...

Is it possible to set a separator for Zend Framework 2 form rows or display them in paragraphs?

php,zend-framework,formcollection

Best thing to do is override the formRow helper with your own version that outputs the markup you want. I wrote a little lib that does just this, feel free to use it or copy the approach. Define your own helper: https://github.com/tfountain/tf-form/blob/master/src/TfForm/Form/View/Helper/FormRow.php and then update your module config to use...

Password protecting Apigility admin UI without htpasswd

zend-framework,zend-framework2,apigility

You don't need password protection for ApiGility UI. Access should only be allowed in the Dev environment. php public/index.php development enable <- to enable the UI php public/index.php development disable <- to disable the UI If you consist of having password protection for it. Then you can add an event...

Zend 1 Redirect to controller from library

php,zend-framework

You should really try to do this kinda thing from a controller, but I've found a use-case for this in a library file as well, so there's no shame in it :-) $redirector = new Zend_Controller_Action_Helper_Redirector(); $redirector->gotoSimpleAndExit($action, $controller, $module, $params); More info here http://framework.zend.com/apidoc/1.9/Zend_Controller/Zend_Controller_Action_Helper/Zend_Controller_Action_Helper_Redirector.html...

Zend File Create folder while uploading

zend-framework,zend-form

You will have to remove ->setDestination from your form and put it in your controller. The following is what you will put in your controller. $upload = new Zend_File_Transfer_Adapter_Http(); if (//code to check if folder '/var/www/upload' does not exist) { //code to create a folder '/var/www/upload' and then set destination...

Is there a way to print out SQL query sentence in phpstorm?

php,zend-framework

You can do this with the __toString() function: $sql = $query->__toString(); ...

Setting up ServiceManager with configuration files in Zend Framework 2

zend-framework,dependency-injection,zend-framework2,servicemanager

You can wire up the Zend\Config\Reader\Yaml to parse your configs, but they aren't going to be any more or less verbose, just a different format. If you prefer that format, feel free, but PHP arrays are exceedingly flexible and useful for config like this.

is not null condition in zend framework 2

php,mysql,sql,zend-framework,zend-framework2

got it..!! $select->where->isNotNull('pe_name'); and $select->where('pe_name IS NOT NULL'); also works....

Zend Cache Static directory configuration in Zend Framework 1.11

caching,zend-framework,config

You can do this globally by setting upload_tmp_dir php configuration variable (in php.ini or httpd.conf).

How I can use custom view helper for form in Zend Framework 1?

php,zend-framework

I do custom form types a bit differently. Instead of adding a decorator to the existing Zend_Form_Element_Radio element, I typically extend the class and set the $_helper as the new view helper I created. So for your class it might be something like this: class Application_Form_Element_NewRadios extends Zend_Form_Element_Radio { $_helper...

Sending Stock Update Email Magento

php,magento,zend-framework

I'm not sure, but I think, you have to change $stockItem = $observer->getEvent(); into $stockItem = $observer->getEvent()->getItem(); ...

How to use group in phpunit?

zend-framework,phpunit

You can simply archive your problem simply list sequential your modules like: phpunit.xml ..... <directory>./application/modules/module1</directory> <directory>./application/modules/module2</directory> <directory>./application/modules/</directory> ..... For the classloading problem try to take a look at this article. Also here talk about classloading problem (and solutions) in the comment. hope this help...

Pimcore multilanguage site static route

php,zend-framework,routing,pimcore

There is the "Sites" - feature in Pimcore that lets you do this. The documentation page describes how you set this up, but I'll explain it quickly: You basically set up your document tree like this, creating a usual document for each of your languages: After this, all you need...

Stuck on No_Frills_Magento_layout section 2.4

php,xml,magento,zend-framework,mage

OK, so based on your comments above, it sounds like getOutput returns an empty string, and that the blank white screen isn't a hidden PHP error, it's the result of Magento/PHP not rendering anything for the layout. First debugging step: Make sure you're loading the complex.xml you think you are....