News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Master Zend Framework:
Change Layout in Controllers and Actions in Zend Framework 2
June 27, 2014 @ 10:07:20

Matthew Setter has a new post to his Master Zend Framework site today showing you how to change layouts in controllers and actions for a Zend Framework v2 based application.

In Zend Framework 2, if you want to change the layout just for one action or for every action in a controller, how do you do it? How do you do it without overriding the layout for every action throughout the entire application? In today's post, based on an excerpt from Zend Framework 2 for Beginners, we see how to achieve both of these requirements.

He talks about the framework's use of the two-step view pattern and what the "template_map" definition usually looks like in a default ZF2 application. He shows three different ways to do the view switching from the controller or action:

  • Override the default layout in your module
  • Override the layout per/action
  • Override the layout per/controller

Each of these comes with a bit of code showing you how to make it work. They move from simplest to more complex, with the layout per controller being the most complex. It's not that it's difficult, it's just that there's more involved to make it work. You can either do it at the controller level or at the module level.

0 comments voice your opinion now!
tutorial zendframework2 controller action change ayout

Link: http://www.masterzendframework.com/views/change-layout-controllers-actions-zend-framework-2

Wojciech Sznapka:
Immutable value objects in PHP
May 16, 2014 @ 09:04:27

Wojciech Sznapka has a quick post to his site today looking at a possible implementation of Value Objects (immutable objects) in PHP applications.

Value objects are one of building blocks in Domain Driven Design. They represents a value and does not have an identity. That said, two value objects are equal if their values are equal. Other important feature is that Value Objects are immutable, i.e. they can not be modified after creation. [...] This post isn't about obvious advantages of representing domain logic with support of Value Object. As well, we wouldn't elaborate here about pros and cons of immutable objects. I'd rather would like to show an attempt to change Value Object.

His change method isn't so much a "change" as a "duplicate with new values" process. In his example he creates a EmailValueObject with "host" and "mailbox" properties. This object has a "changemailbox" method that seems to update the "mailbox" property, but in actuality clones the current object with a new "mailbox" value in the constructor.

0 comments voice your opinion now!
value object immutable clone change property

Link: http://blog.sznapka.pl/immutable-value-objects-in-php/

Loosely Coupled Podcast:
Episode 4 An Agile Rant
May 14, 2014 @ 10:41:37

The Loosely Coupled podcast, hosted by PHP community members Jeff Carouth and Matt Frost, has posted their latest episode. In Episode #4: An Agile Rant they talk about agile development practices and compromises.

In this episode Matt and Jeff talk about their experiences with adopting Agile as individuals and as teams. The important take aways are to not be too loose nor too rigid with the practice; to accept change as it happens but to not force change too rapidly; to honor the purposes of the components of agile practices; and, above all, to find what works for your team specifically over what you read in a book.

Topics mentioned include the Agile Manifesto and the books "Agile Project Management and Extreme Programming Explained. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you like what you hear, consider subscribing to their feed and following them on Twitter.

0 comments voice your opinion now!
looselycoupled podcast ep4 agile rant change

Link: http://looselycoupled.info/blog/2014/05/13/episode-4-an-agile-rant/

Evert Pot:
PHP 5.5.10 timezone handling changes
March 31, 2014 @ 12:29:27

Evert Pot has a new post sharing some of the changes in DateTime handling that he's updated in the latest release in the PHP 5.5.x series.

PHP 5.5.10 got released a few weeks ago, and among other things, it added some new functionality related to timezone handling. In short, [subtracting from UTC] now works. Normally this would not be recommended, as you really should specify timezones based on their geographical location. This information is not always available though, so it's a welcome new feature.

Other changes include the removal of the automatic translation from "UTC" to "GMT" as well as errors being thrown when one of the "odd" timezones are used (he provides the list). Additionally, an update around timezone "guessing" has been added and the fallback that was in place has been removed.

0 comments voice your opinion now!
timezone change datetime utc gmt error names

Link: http://evertpot.com/php-5-5-10-timezone-changes/

QaFoo Blog:
Tracking Changes in PHP Projects
November 20, 2013 @ 11:27:26

The QaFoo team has made available a tool they've created to track changes in PHP projects, the QaFoo Changetrack tool.

Since quite some time I've talked to people about the idea for a tool that tracks changes in the classes and methods of your PHP project in order to detect which entities are changed most frequently, which are often affected bugs and other statistics. After some hacking, we are now making it available on Github.

The tool includes a few commands including one that analyzes the project you point it at (and makes an XML defining its changesets) and another that provides a report of how often a certain method is involved in a change. The post includes an example using the Twig Github repository noting that, because of the analysis being done on each checkout, can take quite a while depending on the age of the project.

0 comments voice your opinion now!
track project change qafoo changetrack github

Link: http://qafoo.com/blog/061_tracking_changes_in_php_projects.html

SitePoint PHP Blog:
A PHP from the Future
August 20, 2013 @ 11:27:12

On the SitePoint PHP blog Timothy Boronczyk has a new post trying to predict the future of PHP and where the language might be heading:

As developers, we find ourselves living in exciting times. With increasing attention paid to online activities, we're working with larger data sets (even "big data"); scalability and connectivity are more important than ever before; the very nature of privacy is being re-examined. But quietly, in the shadow of all of this, sits perhaps a more pragmatic question. How will PHP change and grow to enable us to build the future, whatever it may hold?

Among the things he proposes are ideas about future versions with double-digit minor release numbers, less frameworks and more meta-frameworks, the introduction of lots of new extensions and the adaptation and positive outlook for a thriving, constantly improving web-centric language.

0 comments voice your opinion now!
future language opinion change grow evolve

Link: http://www.sitepoint.com/a-php-from-the-future

Reddit.com:
What would you change about PHP if you could dictate the next major version?
July 24, 2013 @ 12:46:54

In Reddit.com there's a great discussion all started by a simple question - What would you change about PHP if you could dictate the next major version?

We know that PHP has flaws, though it's the best language for web programming, at least in my opinion. How would you improve it?

There's tons of answers (some valid, some are just trolls coming out to play), here's just a few:

  • Named parameters
  • Add scalar type hinting
  • True multi-threading support
  • Property accessors
  • Strings as objects
  • A native namespace
  • Return typing
  • Default autoloading

There's lots of discussion around some of these (and plenty of others not even mentioned) so be sure to check out the full post for more great ideas.

0 comments voice your opinion now!
version change discussion idea version opinion

Link: http://www.reddit.com/r/PHP/comments/1iw0cj/what_would_you_change_about_php_if_you_could

Matt Frost:
Agent of Change Part 2 Presentation
February 05, 2013 @ 09:20:35

Following up on his previous post about being an "agent of change" in your organization (work, open source project, etc) Matt Frost has posted his second part of the series focusing on the presentation of your ideas.

In Part 2 we're going to talk about presentation of the pitch you put together for this change. It's important that your pitch be well researched and in some regards provable, as the Agent of Change the responsibility lies with you to prove the value of your idea. As we touched on in Part 1, a well thought out plan is going to go a long way in breaking down the barriers that make change difficult to take hold.

He makes a strong point that you need to identify the problem you're trying to solve (and what solution you're wanting to propose) clearly before trying to present it to a listening audience. He recommends quantifying your solution in terms everyone can understand like "hours of work" or cost. He recommends coming up with a short "elevator pitch" version to entice and the longer version to fill in the gaps.

You've got slides, documentation, statistics and loads of other good information that is going to benefit your development process, sales people in particular are looking for that jewel that helps set your organization apart; you've got that jewel!
0 comments voice your opinion now!
agent change series practices development presentation


NetTuts.com:
How to Write Code That Embraces Change
February 04, 2013 @ 13:18:58

On NetTuts.com today there's a great new article about how to write code that embraces change and can be easily updated and reconfigured due to a decoupled nature and use of good OOP concepts.

Writing code, which is easy to change is the Holy Grail of programming. Welcome to programming nirvana! But things are much more difficult in reality: source code is difficult to understand, dependencies point in countless directions, coupling is annoying, and you soon feel the heat of programming hell. In this tutorial, we will discuss a few principles, techniques and ideas that will help you write code that is easy to change.

He covers some of the good OOP principles to think about when developing - like cohesion, orthogonality and coupling (via class methods, polymorphism, dependency injection or interfaces). He spends some time looking at the SOLID development principles and how you can implement each of them in some sample code. He also talks some about high level design and how the separation of concerns can help make your code easier to maintain and change.

0 comments voice your opinion now!
tutorial code change oop decouple dependency solid principles


Matt Frost:
Agent of Change Part 1 Preparation
January 08, 2013 @ 09:57:35

Matt Frost has posted the first part of a series he's writing up about being an "Agent of Change" in your development organization with recommendations on how you can make changes for the better happen. In this first article, he looks at working up "the pitch" for new technology and practices.

We all to make changes that make our jobs easier, so if your change isn't meeting a need or helping to ease a pain point, it's probably not the right change. [...] Find something that makes your job harder or less enjoyable, there's a pretty good chance that you aren't the only one.

He recommends doing plenty of research before making your recommendations, especially if it's a "we should be doing, but don't know how to" kind of improvement. He uses test-driven development in his examples, with part of his pitch being that it reduces the number of bugs that make it into production.

When plans are well thought-out and researched, the element of risk that others perceive tends to dwindle. [...] It's not about pointing out the faults of others in the organization or assigning blame, it's about learning and making positive changes from the lessons you've learned.
0 comments voice your opinion now!
agent change preparation series practices development



Community Events





Don't see your event here?
Let us know!


configure testing introduction release developer code unittest podcast library series community language framework install opinion threedevsandamaybe list wordpress interview laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework