 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
WebReference.com: XML and PHP Simplified - Formatting XML Documents
by Chris Cornutt August 06, 2009 @ 08:33:04
WebReference.com has the latest tutorial in their "Simplified XML" series posted today. This installment focuses on the formatting of the documents in the browser and how to read them back in.
We have already discussed the XML functions so let's use an example to demonstrate how they work. First, we get the XML file that we want to use. The idea is to create an XML parser. This will then enable us to read and write to an XML document.
Their examples show code that parses an XML document, outputs a simple list of the values inside and how to take an XSL style sheet and apply it to the data as applied through a xml-stylesheet tag.
voice your opinion now!
simple tutorial xml parse style
phpPro.org: Embedding PHP In CSS
by Chris Cornutt April 13, 2009 @ 12:05:52
New on the phpPro site is this article looking at a technique for embedding PHP inside of your CSS files and have it correctly interpreted.
Perhaps one of the most frustrating aspects of using PHP with websites, is getting variables into CSS. Having variables stored in an ini file, config file or even a database can make the updating of the look and feel of a site simple, however, CSS files, by default, do not parse PHP. [...] A html file may also include a PHP file, in the same manner as it includes a CSS file. This means the stylesheet can be renamed from style.css to style.php.
Using this method, the PHP inside the file is parsed and, because its included with a link tag, the CSS is also made available to the rest of the page.
voice your opinion now!
embed css link parse webserver
Fabien Potencier's Blog: Getting information from SVN with PHP
by Chris Cornutt February 05, 2009 @ 12:08:23
In a recent post Fabien Potencier took a look at one method for getting metadata information from a subversion repository about the project(s) inside.
Last year, I deployed a new tool to manage symfony plugins. The first goal of this tool was to simplify the process of contributing new plugins. [...] The question I wanted to answer was quite simple: How many plugins were created per month before and after the change?
He uses a very handy option to modify the output of an "svn log" command - the "--xml" argument. This outputs the latest information (like author, date, paths and msg) for each of the log entries. This can then be thrown into a call to simple_xml_load_file and parsed down into the numbers he was looking for. He even generated a graph of the results as they coordinated with the different symfony releases.
voice your opinion now!
subversion svn log xml output parse simplexml graph
Mike Lively's Blog: YAML Now Supported by PHPUnit Database Extension
by Chris Cornutt February 02, 2009 @ 07:52:31
Mike Lively has posted about a new bit of support that the PHPUnit unit testing software for PHP has just gotten - YAML data set parsing.
I have now just committed YAML data sets to the Database Extension for PHPUnit. So now all those that love the simplicity and straightforwardness of YAML can use it with your data sets. I have also created a persistor for YAML datasets so you can easily convert existing data sets or database data into YAML representations.
He includes an example of a bit of YAML markup and one of the major hurdles he had to overcome - trailing line breaks (as shown in the table_2/column 8 in the example). This functionality also includes a persistor that lets you convert things back the other day - current data set to YAML markup. You can find out more about data sets in PHPUnit in this section of the project's manual.
voice your opinion now!
yaml dataset phpunit convert parse persistor
Marc Gear's Blog: How to learn a new PHP framework
by Chris Cornutt December 11, 2008 @ 10:20:28
In this new blog entry Marc Gear suggests a few things that you can do to help learn a new framework quickly and easily:
There are dozens of PHP frameworks around now, some attracting more attention than others. I am no expert on these frameworks and have not used a single one extensively so I wouldn't dream of recommending one over the other, nor do I want to enter the debate about what is or is not a framework (I'll work on the assumption that anything calling itself a framework is a framework). Instead I'm going to concentrate on how you can get started with a new framework as quickly as possible.
He suggests four examples that can help you get more familiar with each framework and how they're structured - a "hello world" as a first step, creating a simple calculator, making a guestbook and making a simple script to parse and paginate a remote RSS feed.
voice your opinion now!
learn framework helloworld calculator guestbook rss parse page
SitePoint PHP Blog: Introducing php-tracer-weaver
by Chris Cornutt December 09, 2008 @ 08:49:00
On the SitePoint PHP blog today Troels Knak-Nielsen has posted about a lesser known feature of the popular XDebug debugging tool - function traces.
In case you haven't heard of it before, it "allows you to log all function calls, including parameters and return values to a file", to quote the manual. After playing around with it for a while, I realised that this information could be parsed and used to determine parameter types and return types of functions.
To illustrate one use for the trace results, he create a simple script that parsed them and reinjected them back into a source file as docblock comments. Included in the post is an example of its usage and the resulting comments for a simple class. It can be downloaded from github.
voice your opinion now!
xdebug trace function tutorial github application parse docblock comment
|
Community Events
Don't see your event here? Let us know!
|