php



PHP Magic Constants

Other

In developing process, if you want to store a value that will remain the same along your script’s execution, you can define a constant.

Also PHP has some magic constants like PHP_VERSION, __LINE__, __FILE__, E_ERROR, __DIR__, __FUNCTION__, __CLASS__, and __METHOD__, E_ALL and others wixh can help you in your application development.

Read More

Top 5 Design patterns used with PHP

Design patterns

In this article i will make a list with most used five design patterns used in PHP, based on my experience and other observations from IT PHP community.

So in my opinion most used design patterns in PHP are: MVC(Model-View-Controller), Singleton, Registry, Observer, Factory.

Read More

Disable default decorator(s) for Zend_Form_Element

Zend Framework

In this article i will describe some methods to remove/disable default decorators from Zend_Form_Element. Basicly are two method, one by calling some method if we had an instance of object Zend_Form_Element, and other if we extend or we build a custom Zend_Form_Element is from init method.

 

Read More

Magento calls

Magento

Using block, models, helpers and other magento specific structures, is a little bit different from other PHP frameworks/platforms. In this article i show how to use these structures by calling them in other modules/places.

So, for calling a model structure in magento you can use this function:

Read More

PHP Data Types

Other

A data type is defined as a set of entities and the allowable operations on those values. Almost all programming languages explicitly include the notion of data type, though other languages may use different terminology.

And PHP has defined several data types.

Read More

PHP 5.4 - what,s new?

Other

This article contains few words about what is new and what was changed in PHP 5.4.

Here are some main features of php 5.4:

Read More

About TDD

Other

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.

In test-driven development a developer creates automated unit tests that define code requirements then immediately writes the code itself. The tests contain assertions that are either true or false. Passing the tests confirms correct behavior as developers evolve and refactor the code. Developers often use testing frameworks, such as xUnit, to create and automatically run sets of test cases.

Read More

PHPUnit Annotations

Other
An annotation is a special form of syntactic metadata that can be added to the source code of some programming languages. While PHP has no dedicated language feature for annotating source code, the usage of tags such as @annotation arguments in documentation block has been established in the PHP community to annotate source code.
With PHPUnit annotations you can write PHPUnit tests in a simle and unconventional way.

Read More

Zend Framework Intro

Zend Framework

Zend Framework is an open source, object oriented web application framework for PHP 5.

Zend Framework is often called a 'component library', because it has many loosely coupled components that you can use more or less independently.

Read More

Magento customize methods (events)

Magento
There two main ways with magento code can be customized, using events, and overriding classes. In this article it will be described in more details using events method. Magento is written in OOP manner and implements "observer pattern". So this mean that in key point of application magento has events and make dispatch of this events. This allows us to inject code in magento normal workflow, and change defauult behavior.
Events customization method has advanced that can be used for multiple times and with other customized code (extension), without risk to appear conflicts in another module or extension that override same piece of code(extension/module) like your code(extension/module) but it has disadvantage to not be able to change magento logic/workflow completely.

Read More