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

Master Zend Framework:
Howto Handle External Form Element Dependencies with FormElementManager
Apr 22, 2014 @ 16:58:07

The Master Zend Framework site has posted a tutorial wanting to help you understand external form element dependencies with help from FormElementManager.

Zend Framework 2, like all great PHP frameworks, provides thorough infrastructure for creating forms in your application. Whether that’s form objects, form elements, fieldsets, validation groups or that they interact with so many other components in the Zend Framework 2 default libraries. But how do you handle external dependencies? [...] So what if you need a custom form element in your application, one which will render a list of articles from a database table? [...] In today’s post, we’re going to look at how to create such a custom element, extending the existing select element.

He walks you through the steps you'll need to make the custom element and hook it into the FormElementManager for correct use:

  • Create a New Form Element
  • Implement the getFormElementConfig Method
  • Create a New Form Object
  • Instantiate the Form Via the FormElementManager

Code is included for each step of the way so you can ensure you end up with a working example.

tagged: external form manager element dependencies external tutorial

Link: http://www.masterzendframework.com/zend-form/handle-external-form-element-dependencies-with-formelementmanager

Master Zend Framework:
Howto Handle External Form Element Dependencies with FormElementManager
Apr 22, 2014 @ 16:58:07

The Master Zend Framework site has posted a tutorial wanting to help you understand external form element dependencies with help from FormElementManager.

Zend Framework 2, like all great PHP frameworks, provides thorough infrastructure for creating forms in your application. Whether that’s form objects, form elements, fieldsets, validation groups or that they interact with so many other components in the Zend Framework 2 default libraries. But how do you handle external dependencies? [...] So what if you need a custom form element in your application, one which will render a list of articles from a database table? [...] In today’s post, we’re going to look at how to create such a custom element, extending the existing select element.

He walks you through the steps you'll need to make the custom element and hook it into the FormElementManager for correct use:

  • Create a New Form Element
  • Implement the getFormElementConfig Method
  • Create a New Form Object
  • Instantiate the Form Via the FormElementManager

Code is included for each step of the way so you can ensure you end up with a working example.

tagged: external form manager element dependencies external tutorial

Link: http://www.masterzendframework.com/zend-form/handle-external-form-element-dependencies-with-formelementmanager

ServerGrove Blog:
Symfony2 components overview: Process
Apr 18, 2014 @ 17:41:41

The ServerGrove blog has posted their latest Symfony2 component spotlight, this time focusing on the Process component.

The Symfony2 Process component, allows us to execute commands in sub-processes. [...] The Process component provides an object-oriented abstraction on top of proc_* functions to execute independent processes from PHP.

As with the other posts in the series, they walk you through the installations via Composer and some examples of its use. The post also shows the use of exit codes, working with long running processes and how to execute PHP code in the command. They also briefly look "under the hood" at how the component does what it does (on top of the proc_* functions).

tagged: symfony2 component process external command overview

Link: http://blog.servergrove.com/2014/04/16/symfony2-components-overview-process/

Lukas Smith:
__toString() or not __toString()?
Aug 28, 2013 @ 14:14:39

In Lukas Smith's latest post he looks at one of the magic methods that's built into PHP to help transform objects into strings - the __toString method. In the post he explores what it's for and what it might be used for.

The __toString() belongs to the family of methods and functions called "magic functions". They are magic because for the most part they do not get called explicitly but rather intercept operations. Unfortunately there are limits to its magic, specifically the only "context" the method is aware of is its design contract: to return a string. But its not clear what purpose that is. Should this be for some internal debugging or logging purposes? There one would be most interested in internal identifiers and object state. Is it for some frontend UI where the user will most likely be interested in some textual identifier that isn't too long as to not clutter the UI. There in lies the dilemma in the magic, while useful there is no way to ensure that the given context is passed on.

He looks at use cases for UI output (for consistent output) and contexts as well as the more internal-facing usage, like for logging and debugging purposes. Being able to get the context of the object as a string and pushed into a log at the time of error could be immensely helpful for debugging. He also links to some discussions happening on Twitter about the internal versus external uses of this magic method.

tagged: tostring magicmethod usecase internal external

Link: http://pooteeweet.org/blog/0/2231#m2231

DZone.com:
External processes and PHP
Feb 14, 2013 @ 17:29:04

In a new tutorial over on DZone.com Giorgio Sironi talks about handling external processes in PHP and how to work with streams.

I've come to known a bit about spawning and monitoring new processes from PHP code, while working at Onebip and trying to contribute to Paratest. Here's what you need to know if you think exec() or executing everything in a single .php script is always enough.

He starts with a look at the differences between using things like exec and streams for handling the spawning of other processes. He shows how you have more control when you go with the streams option and process handling with the "proc_*" methods. He also touches on some other things to think about like stream blocking, sleeping and dealing with multiple execution streams (and switching between them).

tagged: external process tutorial stream handling

Link:

DZone.com:
TravisCI Intro and PHP Example
Mar 22, 2012 @ 17:20:26

In introduces you to using TravisCI to provide continuous integration services for your project (externally). Continuous integration is a way to provide "quality control" of your code, making it easier to run testing, check syntax and more, small pieces at a time.

Travis CI in fact works by tying itself to a particular project on Github, and by triggering a new build every time new commits are available on the chosen branch (master, usually). Your build shows up on the main page along with all the other projects in the newsfeed, so try to maintain it green. :) Travis CI adds this other aspect to Github's social coding.

He talks a bit about how it works - builds running on VMs, some with advanced tools like Selenium - and includes an example based off a simple travis.yml file defining a script to run pre-build. He also points out a special caveat about databases - they support things like MySQL, Sqlite, MongoDB and CouchDB, but you'll have to generate them from scratch every time, sample data and all.

tagged: travisci example continuous integration external tutorial

Link:

SkyTechGeek.com:
10 Exceptional Tools For Website Testing
Aug 23, 2011 @ 18:25:22

Sometimes a little (external) testing of your website is in order and Gagan Chhatwal has posted his list of ten tools you can use to check everything from how much load the site can take to what can be done to optimize the load time.

When maintaining or running a website , Webmasters need to keep in mind that one of the pertinent issues they will need to focus on is :Website Testing, which is not only vital for the website itself but for the user as well and one should not overlook its importance. [We have] collected some vital and free website testing tools which will help Webmasters in testing their sites thus saving users to conduct time consuming needless searches in finding the best resources pertaining to Web related tools and info.

Among the tools on the list are services like:

Most of these resources are free services, if not then they have a trial where you can see if it's a good fit.

tagged: testing external service load validate speed monitor

Link:

Juozas Kaziukenas' Blog:
How to use external libraries in PHP?
May 24, 2009 @ 01:26:09

As a part of his work for the WinPHP Challenge Juozas Kaziukenas looks at some of the external library types that you can use with your (Windows) PHP applications.

External libraries are useful for performance demanding tasks where PHP is simply too slow. Also PHP can work as front-end system for various back-end systems (where server doesn't provide any PHP supported communication types). I have written some posts about using .Net libraries in PHP so far, but there are some other choices available too.

He looks at the three types of library choices - PHP extensions, exec call. For what he wants to do, though, the COM objects are the best fit for the job.

tagged: external extension pecl com

Link:

CSS-Tricks.com:
Using Weather Data to Change Your Website’s Appearance through PHP and CSS
Feb 18, 2009 @ 18:08:03

On the CSS-Tricks.com site today there's a quick tutorial on changing up the look and feel of your site based on an external source. More specifically, they give the example of updating the graphics of your site depending on the weather in your area via PHP and CSS.

Using a little magic and trickery (read: PHP and CSS), we can change the appearance of a website automatically based on the weather outside, in real time! In the example site we have created, the header graphic will change to one of four different styles based on Sunny, Rain, Snow, and Cloudy.

Their example makes a request to the Yahoo! weather data for a location and brings it in to PHP where the XML is parsed (via a regular expression) and the current conditions are parsed out. This condition is then passed out into the page as the class type on the header and, based on the CSS already defined, the correct image is pulled in as the background.

tagged: weather data yahoo change header css graphic external source

Link:

PHPBuilder.com:
PHP Developer Resources
Nov 21, 2008 @ 14:07:39

PHPBuilder.com has posted a list of resources that they offer to help both beginning and experienced PHP developers to further their knowledge:

PHP is one of the most popular scripting languages used to develop applications on the web today. As a result, internet.com has a multitude of PHP resources throughout our network of websites. Here are some of our best PHP resources, along with some featured tutorials and out-of-network resources that you may not know about.

The grouping of links also include external resources like the main PHP site and Zend's website.

tagged: developer resource list link internal external zend

Link:


Trending Topics: