Since Magento uses the Zend Framework you are able to use Zend_Date to easily display localized dates in Magento. So, first create a Zend_Date object based on the locale set in the administration backend: Then simply output your date as localized string using Zend_Date->toString: Us usual, find formating rules in the Zend_Date constants documentation.
When managing smaller GIT based projects I find it helpful to opt for custom build scripts rather than having to deal with the overhead of setting up proper Jenkins (or-likewise) runtime environments. In order to deal with this need I’ve created a simple build script that creates a compressed TAR file based on committed files. […]
Using Facebook to authenticate users to access your website or application is quite easy. In fact, based on the underlying OAuth you can provide your users a convenient way to authenticate with their existing Facebook credentials. This saves your users the hassle of remembering additional login credentials and possibly reduces the amount of data your […]
This post continues my approach to integrate Doctrine 2 into Zend Framework 2 by additionally setting up YamlDriver to generate and manage Doctrine 2 Entity model mapping files. First, we need to install the YAML dependency symfony/yaml: And rebuild our project: In case you forget the install the symfony/yaml module you will get an error […]
In case you forgot your Mantis BugTracker password here is a a simple way to reset it. This approach assumes that you have write access to the database table mantis_user_table. So in order to reset the password for a given user find and update the respective entry’s password column with a MD5 hash value of […]
In case you need to disable Zend View’s Renderer because you want to return custom data (JSON, XML, etc.) simply using the following lines to do so: Then you can return your response in any format you want, just don’t forget to set the content type accordingly. That’s it.
When using Zend_Form’s multi-select with dynamically set options you need to make sure to update your options and the InArray validator accordingly when validating data using form->isValid(). In order to update selection options and update the InArray validator we need to first set the options, remove the currently set InArray validator and set it with […]
Sometimes Smarty’s syntax is not quite self-explanatory. Recently I was asked how loop counters can be implemented for foreach-loops. According to the API docs there’s an @iteration directive for this case, such that the following should work: Unfortunately, the value remained 0 regardless of the current loop iteration. Another (working) approach is to specify a […]
I have been using SMS Server Tools 3 (smsd) for numerous projects in the past due to its stability and configurability. Since smsd does not provide a graphical UI out-of-the-box I have decided to develop a web interface for users to be able to manage their SMS data, much like an e-mail application, called SMS […]
In a recent project the primary goal was to deliver a fully functional soundmixer based on ActionScript and Flash. Users should be able to mix a pre-defined set of sound samples by dropping them onto multiple tracks, as shown in Figure 1. By hitting the record button the samples selected should be mixed and made […]
Operating interational websites and portals naturally requires multilanguage support and localization. Especially more prominent frameworks provide i18n support right out of the box. One of these is Silverstripe which recently has been released in version 3. This brief article describes the steps required to activate multilanguage support in Silverstripe. First of all, you need to […]
Sometimes Zend’s built-in form decorators are not flexible enough to achieve customized views. Luckily, Zend provides means to specify custom view scripts. The following example demonstrates how to set and handle such a script. First and foremost, in your default (action) view script simply output the form as usual: Then, in your derived Zend_Form class […]
In case you need to return content types other than the one set by server (Apache, etc.) or Zend itself use the following lines to quickly control Zend’s layout rendering and Content-Type specification. This is crucial for instance if your controller is required to return JSON or XML as part of a service request.
File uploads can be managed quite easily using Zend_Form. First off, create a Zend_Form instance and add a Zend_Form_Element_File element, representing the file-input element. Make sure to set the encoding type to multipart/form-data: Now that we have a form let’s add the logic in the corresponding controller. We only need one action (imageAction) to process […]
There seems to exist a lot of confusion when it comes to (programmatically) posting to Facebook (FB) fanpages through the PHP SDK, especially when trying to post as one of the page’s admin through an app via impersonation. Thus, instead of posting through your regular FB user account you want to directly post to a […]