Click Fraud Protection
PHP related blog, freelancer to hire!

Archive for the Zend Framework Category

How to access magento search results externally (Drupal, Joomla, Zend Framework, Symfony etc)

Blast Search Lucene module enables you to get superquick results delivered to external application Options are: 1) if applications are on the same server you can simply include Magento code and use module method:   $queryText = ‘stainless’; $storeId = 1; $mageFilename = ‘../path_to_your_magento_document_root/app/Mage.php’; require_once $mageFilename; umask(0); […]

Read more

Zend Paginator – how to access objects, not data only

If you’re using Zend_Paginator, I’m sure on some point you’ll need to access your object instead of only data.   First of all you need to have your Zend_Db_Table defined with rowchild, for example if your table class is App_Model_Db_Books, add this variable protected $_rowClass = ‘App_Model_Db_Books_Row’; […]

Read more

Zend_Test_Client problem with GET parameters in path

Let’s say you want to send REST request to http://test.server.int/articles and your provider requires to send token parameter – but in URL So your final url will be http://test.server.int/articles?token=12345 My client looked like: $rest = new Zend_Rest_Client(‘http://test.server.int’); $rest->restGet(‘/articles?token=123’, array(‘article’ => ‘<xml>YOUR XML</xml>’)); Fatal error: Uncaught exception ‘Zend_Uri_Exception’ […]

Read more

Use PHP and PDO to connect to MS SQL Server (Zend Framework)

Problems connecting to MS SQL server from Zend Framework? Message: The mssql driver is not currently installed Solution is simple Install pdo_mssql driver: (Ubuntu) #sudo apt-get install php5-sybase #sudo /etc/init.d/apache2 restart On Centos you need to install pdo_dblib (any problems check here) It will not reflect in […]

Read more

Zend_db_table how to find row by multiple columns?

Maybe should dig more in ZF API, but found simple solution: class YourClass extends Zend_Db_Table_Abstract { public function findOneByParams(array $params) { // prepare query $query = $this->select(); // add our terms foreach ($params as $param => $value) { $query->where($param.’ = ?’, $value); } // find row $row […]

Read more

Zend Framework on-line tutorials/documentation

Last time I was using ZF when it was something around 1.5, so I was quite shocked when downloaded version 1.7 and started to use it. Documentation is quite ok, when you know what you want to do, but of course it is better when someone else […]

Read more

HTML code in Zend Forms description

If you want to use HTML as description in Zend Forms use : $name = new Zend_Form_Element_Text(‘fullname’); $name->setLabel(‘Full name:’); $name->setDescription(‘Find customer’);

Read more