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

ServerGrove Blog:
Editing Twig Templates in Dreamweaver
Mar 04, 2011 @ 10:16:28

On the ServerGrove blog today there's a new post showing how you can set up Dreamweaver to be able to edit Twig templates directly, complete with syntax highlighting.

If you are a designer working with Symfony developers you will soon encounter Twig. Twig is a template engine for PHP that has been adopted by Symfony 2, and from a designers perspective, it’s a major improvement over the way things are done in Symfony! For designers who have used templating systems like Smarty before, Twig is going to be a walk in the park, if you have not used a templating system before, Twig is a great place to start.

It's a simple two-step process to get things up and working. You just need to tell Dreamweaver that ".twig" files should be recognized as code and set up the syntax highlighting in the "MMDocumentTypes" XML configuration file (might be a little tricky for non-development types). This change tells the program to open them with HTML syntax highlighting.

tagged: edit tig template dreamweaver syntax highlight html

Link:

Mayflower Blog:
PHP_CodeBrowser goes stable
Dec 15, 2010 @ 10:54:22

According to this new post on the Mayflower blog, the PHP_CodeBrowser PEAR package has finally reached a stable state.

We already wrote about CodeBrowser 0.9 in August and after fixing a few minor bugs the Mayflower Open Source Labs Team is very happy to present PHP_CodeBrowser 1.0.0.

The PHP_CodeBrowser package allows quality assurance tools (like PHPUnit) to create enhanced output including syntax highlighting and colored error sections. It comes with some basic template, CSS, Javascript and image files as well as a plugin system to allow for custom handling of certain error types. You can install it from the pear.phpunit.de PEAR channel or you can check out the source on github.

tagged: phpcodebrowser syntax highlight stable qualityassurance pear package

Link:

Thomas Weinert's Blog:
Highlight Words In HTML
May 10, 2010 @ 10:34:24

In the latest post to his blog Thomas Weinert takes a look at a simple challenge someone asked him about - highlighting a section of HTML based on a search string - and his solution.

The challenge is to wrap given words in text content with a span and add a class to the span depending on the word. Do not touch elements, attributes, comments or processing instructions. Do it case insensitive and do it the safe way.

He uses the FluentDOM tool to get the job done. It allows him to create an XPath expression to single out the item to be highlighted (in this case a single or series of words) and wrap them in a matching span tag with the correct styles attached.

tagged: fluentdom tutorial highlight word

Link:

Matthew Weier O'Phinney's Blog:
Syntax Highlighting for Technical Presentations
Mar 11, 2009 @ 10:22:17

If you've given any kind of technical presentation, you know that presenting code samples (clearly) can be one of the larger challenges. Matthew Weier O'Phinney has found a solution that works well for him and his slides - Highlight.

Being a technical presenter, I've often run up against the issue of how to present code snippets. The easiest route is to simply cut-and-paste into your presentation software. However, such code is basically unreadable. [...] The first trick I tried was to take screenshots of gvim. However, this had distinct downsides. [...] The next trick I tried was to use Zend Studio or Eclipse to create my screen shots.

He talks about the tool (Highlight) and its use - basically you specify the input, output and the language it needs to highlight for with more fine-tuning options like font size, line width and more. Compare this and this to the end result of Highlight here to get a feeling for how the product might look.

tagged: syntax highlighting slide presentation highlight tool example

Link:

Maggie Nelson's Blog:
Finally, pretty syntax highlighting for blog posts!
Mar 02, 2009 @ 12:52:27

Maggie Nelson points out a cool way that you TextMate users out there can get better syntax highlighted code for your blog posts.

A coworker, Craig Campbell just launched a new blog recently. One of the really neat things about his blog is how he handles syntax highlighting for code samples - check out examples in his interesting post about Cool Object Building with PHP. In fact, he got so many good comments about this approach that he even wrote a post explaining exactly how he does it: Syntax Highlighting for Your Blog Using TextMate.

Craig's process is as simple as selecting the TextMate bundle and choosing "Create HTML from Document with Line Numbers". The resulting output takes a little tweaking in the HTML and CSS, but the end result is quite nice (and better than several of the syntax highlighting plugins out there).

tagged: blog syntax highlight textmate export html css

Link:

Scott MacVicar's Blog:
Source Code Highlighting within Slides
Jun 10, 2008 @ 09:31:31

Scott MacVicar shares a helpful hint for the PHP speakers out there - how to apply syntax highlighting to the code in your slides.

I use Apple's Keynote for doing my presentations and naturally these include some bits of code that need highlighting so that it’s easier to read. [...] In the end I used GESHI which is a highlight library written in PHP that supports the syntax highlighting of around 50 different programming and scripting languages.

He's provided his sample implementation to help you get up and running. You'll need to download and install GESHI to get it working though. Here's an example of the output.

tagged: source presentation keynote slide highlight geshi

Link:

Rob Allen's Blog:
New Zend Framework Blog/Website
Jan 04, 2008 @ 08:45:00

As a part of the release of the new book from Manning Publishing, Zend Framework in Action, Rob Allen has created a new site to act as a companion and to host new Zend Framework-related articles - ZendFrameworkBook.com.

The intention is to highlight interesting things that I see on the Zend Framework mailing lists and also to talk about book stuff periodically as well.

A good bit of the content will be summarized from the Framework's mailing lists but will also include other articles/tutorials/updates on proposals/etc that are happening in that community.

tagged: zendframework blog website book manningpublishing highlight mailinglist zendframework blog website book manningpublishing highlight mailinglist

Link:

Rob Allen's Blog:
New Zend Framework Blog/Website
Jan 04, 2008 @ 08:45:00

As a part of the release of the new book from Manning Publishing, Zend Framework in Action, Rob Allen has created a new site to act as a companion and to host new Zend Framework-related articles - ZendFrameworkBook.com.

The intention is to highlight interesting things that I see on the Zend Framework mailing lists and also to talk about book stuff periodically as well.

A good bit of the content will be summarized from the Framework's mailing lists but will also include other articles/tutorials/updates on proposals/etc that are happening in that community.

tagged: zendframework blog website book manningpublishing highlight mailinglist zendframework blog website book manningpublishing highlight mailinglist

Link:

Felix Geisendorfer's Blog:
MacGyver menu for CakePHP - What's the active menu item?
Jul 09, 2007 @ 09:34:00

In a new post to his blog today, Felix Geisendorfer talks about view coding - specifically working with a menu and determining which element is active.

One of the challenges many of us have faced before and will face in future is building a menu. Now this of course is very simple assuming that we're just shooting for a static <ul> with some <li>'s containing the links. However the tricky part is to figure out what is the active menu item. I had some code doing this in the past but tried out a new flavor of it today which I call the MacGyver menu for CakePHP as it's a little dirty yet powerful and easy to maintain.

In his included code, he creates a simple navigation from an array of titles/links and, with some sorting, a regular expression and a CSS class, the selected item can be highlighted simply.

tagged: cakephp framework navigation highlight active menu cakephp framework navigation highlight active menu

Link:

Felix Geisendorfer's Blog:
MacGyver menu for CakePHP - What's the active menu item?
Jul 09, 2007 @ 09:34:00

In a new post to his blog today, Felix Geisendorfer talks about view coding - specifically working with a menu and determining which element is active.

One of the challenges many of us have faced before and will face in future is building a menu. Now this of course is very simple assuming that we're just shooting for a static <ul> with some <li>'s containing the links. However the tricky part is to figure out what is the active menu item. I had some code doing this in the past but tried out a new flavor of it today which I call the MacGyver menu for CakePHP as it's a little dirty yet powerful and easy to maintain.

In his included code, he creates a simple navigation from an array of titles/links and, with some sorting, a regular expression and a CSS class, the selected item can be highlighted simply.

tagged: cakephp framework navigation highlight active menu cakephp framework navigation highlight active menu

Link: