News Feed
Sections

News Archive
feed this:

ProDevTips.com:
Extending PHP Doctrine Record - Check Box Groups
August 12, 2008 @ 13:26:36

In the third part of the series dealing with using Doctrine in your PHP applications, ProDevTips has this third part looking at a method for extending the tool's current functionality.

I simply knew we would need the extension capability that the Mdl class allows for sooner or later, I didnâ'™t expect it to be this soon though. The main problem here is saving a many to many relationship straight to the database from the $_POST array, to do that we can extend Doctrine Record with a new function I have named fromArrayExt which adds something extra to the normal fromArray method.

He shows how to extend the classes to create custom handlers for a grouping of checkboxes. The new code automatically handles their submitted values and pushes them directly into the database (with a simple save() call).

0 comments voice your opinion now!
doctrine record tutorial checkbox extend group



Paul Jones' Blog:
Exceptional command-line PHP
August 08, 2008 @ 09:34:59

In a new post to his blog, Paul Jones anout a small issue when working with the PHP 5.2.5 command line functionality - a segfault if you extend the Exception class.

When executing code at the command line using php -r and PHP 5.2.5, be sure not to extend the Exception class. It will cause a segmentation fault.

He includes examples of the issue that would cause the problem and the bug he's filed in an effort to get it fixed.

0 comments voice your opinion now!
exception commandline php5 extend segfault


Matthew Turland's Blog:
Simplifying Zend_View_Helper_Url
July 14, 2008 @ 08:48:18

Matthew Turland has posted a quick tutorial where he aims to simplify some of the functionality that the Zend Framework's Zend_View_Helper_Url view helper has to offer.

When I first began working with Zend_View on a project at work, I noticed that the Url view helper was a bit of a pain to use. It was rare that I didn't want to specify one or more of the action, controller, and module in my call along with the other Route assembly parameters.

He wanted to be able to get around some limitations of the helper - use arrays to help label the calls more readable and to be able to refer to other actions in the same controller. He actually made another view helper, one that extends Zend_View_Helper_Url with a few optional parameters including the extra data he wanted in an array. You can see the code at the bottom of his post (he credits Andy Best with development on the idea too).

0 comments voice your opinion now!
zendframework viewhelper zendviewhelperurl url extend class


ProDevTips Blog:
Extending Zend DB Table
June 20, 2008 @ 09:44:58

On the ProDevTips blog, there's a new post showing how to bend the Zend_Db table component of the Zend Framework to your will and customize parts of it for your application.

For some time now I've been working on an administrative backend system. I quickly found the need to extend DB Table with more stuff than needed when I extended the Zend Framework, it's mostly convenience functions designed to reduce repetitive code snippets.

He illustrates with some of the custom override functions he's made including versions of updateOne, exists, fetchOne and fetchSomething.

0 comments voice your opinion now!
extend zenddb component zendframework table customize


Martynas Jusevicius' Blog:
PHP 5 Features Exceptions
March 25, 2008 @ 10:21:11

On his blog today Martynas Jusevicius talks about a feature that was new in PHP5 - Exceptions:

A useful new feature in PHP 5 is exception handling via the try/throw/catch paradigm. An exception may be thrown and caught. If an exception is thrown in code surrounded by try, the following statements will not be executed, and the exception will be handled by the first matching catch block.

He gives a high-level overview of how Exceptions in PHP5 work and includes a simple example from his work with his DIY Framework.

0 comments voice your opinion now!
php5 exception feature try catch extend framework


Arnold Daniels' Blog:
A dark corner of PHP class casting
February 20, 2008 @ 12:08:00

In this blog entry Arnold Daniels talks about an issue he had in the past (needing a bit more functionality than the PEAR DB library could offer) and how he ended up solving it with what he calls a "dark corner" of PHP - class casting.

PHP has a function serialize, which can create a hash from any type of variable, scalars, array, but objects as well. Using the unserialize function, PHP can recreate the variable from the serialized hashed. If we look at how an object is serialized, we see only the properties and the class name are stored.

His method allows for class manipulation via changes to the serialized class information (like changing the value of the name parameter). His "casttoclass()" function makes changing this value simple.

0 comments voice your opinion now!
class casting serialize extend parent child


Gergely Hodicska's Blog:
Extending Zend_Acl to support custom roles and resources
November 30, 2007 @ 07:56:00

Gergely Hodicska has posted about some hacking he's down with the Zend_Acl package in the Zend Framework to make support for custom roles and resources.

I found that the base Zend_Acl package has some limitation/problem if you want to use it in a bigger real life project. Zend_Acl supports only logical roles, resources so I decided to extend it to allow using custom roles and resources which can represent existing entities (for example users/groups and topics in a database)

He talks some about the package and its current functionality, including the limitations he ran up against. He came up with a structure for what he wanted (seen here) and set out to extend the class, making an interface and implementing it with his own loading method.

His source code can be downloaded here.

0 comments voice your opinion now!
zendframework zendacl access control implement extend zendframework zendacl access control implement extend


Maarten Balliauw's Blog:
Generic arrays in PHP
October 25, 2007 @ 08:50:00

On his blog, Maarten Balliauw has an interesting new post dealing with the use of generics in PHP:

Assuming everyone knows what generics are, let's get down to business right away. PHP does not support generics or something similar, though it could be very useful in PHP development. Luckily, using some standard OO-practises, a semi-generic array can easily be created, even in multiple ways! Here's the road to PHP generics.

He shows the two ways to make generics possible - the hard way (simple inheritance and type hinting) and the more flexible way (a GenericArrayObject that extends the normal ArrayObject to make appending and validating the contents of the array simple).

1 comment voice your opinion now!
generic array arrayobject extend filter validation generic array arrayobject extend filter validation


Tobias Schlitt's Blog:
PHP@FrOSCon - Call for papers extended
June 12, 2007 @ 15:53:51

Tobias Schlitt has posted a new note today about the extension the FrOSCon committee has put on the Call for Papers for this year's conference:

Here comes the reminder and the announcement, that our call for papers is extended until June 29th. So if you did not send your proposal, yet, please submit it ASAP, so that we can start evaluating the proposals. All information about PHP@FrOSCon can be found on our official PHP room website.

The conference will still be happening on August 25th and 26th in Sankt Augustin and only costs five Euro to attend (unless you're a speaker, then it's free). Be sure to check out the conference website for the requirements that you'll need to stick to for your talk submission.

0 comments voice your opinion now!
froscon2007 conference callforpapers deadline extend froscon2007 conference callforpapers deadline extend


Spindrop.us:
sfZendPlugin (a Zend Framework plugin for Symfony)
April 11, 2007 @ 10:03:00

In a new post to the SpinDrop blog, Dave Dash talks about his integration of the Zend Framework into a symfony installation - inside a plugin.

I originally intended to rewrite my Zend Search Lucene tutorial, but Peter Van Garderen covered the bulk of whatâ'™s changed and I was too busy developing search functionality for lyro.com (not to mention finding inconsistencies with the Zend Search Lucene port and Lucene) to finish the tutorial. So I broke it up into smaller pieces.

I packaged Zend Framework into a symfony plugin. symfony is easily extended using plugins.

He includes the method he used to get the plugin up and working (downloading his custom ZF plugin) and how to use the Zend Framework Bridge to get it and symfony cooperating.

3 comments voice your opinion now!
symfony zendframework plugin integrate extend symfony zendframework plugin integrate extend



Community Events











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


book PEAR package cakephp conference example mysql developer application zendframework security release ajax code zend releases PHP5 framework database job

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