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

SitePoint PHP Blog:
Integrating Polymer/Dart and Symfony - Part 2
January 21, 2014 @ 13:05:11

On SitePoint's PHP blog Taylor Ren has posted the second part of his series looking at integrating Polymer/Dart and the Symfony framework to make a simple browser-based widget. The first part of the series can be found here.

If the server (and thus the configuration, the programming) is managed by ourselves, the process to get data from a RESTful API from that same server will be simple. We can enable CORS in the returned response header. Done! But if the remote server's RESTful API does not set that header, we will face a CORS error when we try to invoke that API call from within the Dart app.

He offers one solution - JSONP - but dismisses it because of its "hacky nature". Instead he opts to use the PHP (Symfony) side to grab the data from the remote feeds and pull it into the local domain for the widget to fetch. Code for both the client side and server side functionality are included as well as the HTML markup to create the page for the widget.

0 comments voice your opinion now!
polymer dart tutorial symfony javascript part2 widget

Link: http://www.sitepoint.com/integrating-polymerdart-symfony-part-2

ZetaCode.com:
PHP GTK tutorial
November 18, 2011 @ 12:41:30

Jan Bodnar has pointed out a great PHP-GTK tutorial on ZetaCode.com that walks you through some of the major points of this graphical frontend for PHP:

This tutorial will teach you the basics of GUI programming with the PHP GTK. The tutorial has 8 chapters which cover the first steps with the library, menus, toolbars, dialogs and various widgets. It has some examples for drawing with Cairo library. The final chapter presents a small computer game; The Nibbles.

Each of the topics has sample code and screenshots of the resulting output for each. Also included is information on layouts and "painting" with Cairo - drawing shapes, rectangles, text, etc.

0 comments voice your opinion now!
phpgtk graphical frontend tutorial widget cairo


SitePoint PHP Blog:
How to Create Your Own Twitter Widget in PHP, Part 3
January 07, 2011 @ 10:23:59

The SitePoint PHP blog has part three of their "create your own Twitter widget" series posted today. This is the last post of the series and involves a little cleanup on the data pulled from the Twitter API.

In part 1 of this series, we examined the Twitter API, created a PHP TwitterStatus class, and imported the latest tweets in JSON format. In Part 2, we parsed the Twitter data, replaced links, and generated the complete HTML for our widget. In this last post, we'll cache our widget and translate tweet dates into a friendlier format - download the full source code here.

They talk about caching the data pulled back from the API (making it faster and less resource-intensive) and how to parse the dates that you get back from the request using the DateTime functionality included with PHP.

0 comments voice your opinion now!
twitter widget rest api tutorial series cache dates


SitePoint PHP Blog:
How to Create Your Own Twitter Widget in PHP, Part 2
January 06, 2011 @ 12:05:40

On the SitePoint PHP blog today Craig Buckler is back with the second part of their series on creating a Twitter widget for your site. You can find more about the first part of the series here.

In Part 1 of this series, we examined the Twitter API, creating a PHP TwitterStatus class, and imported the latest tweets in JSON format. Today, we'll populate the data into HTML templates - download the full source code here.

The templates are strings of HTML with tags for where the content belongs - in this case things like "{TWEETS}" and "{profile_image_url}". Regular expressions are used to parse the templates and a str_replace used to make the substitution. The final product is included showing a few example tweets with some parsed links inside each.

0 comments voice your opinion now!
twitter widget rest api tutorial series template


SitePoint PHP Blog:
How to Create Your Own Twitter Widget in PHP, Part 1
January 05, 2011 @ 13:13:00

From the SitePoint PHP blog today there's a new tutorial from Craig Buckler (part one of a series) on how to create your own Twitter widget you can drop in anywhere on your site (main content or sidebar). It uses cURL to make the requests to the Twitter servers, so you'll need that installed on your PHP instance.

Because you can! Your own widget will always be more customizable than any off-the-shelf solution, and you'll be the envy of your peers. We've also been asked by several readers for articles about the topic, and it's a great introduction to PHP, REST APIs, JSON, regular expressions and Object Orientated Programming.

In this first part of the series, he helps you set up the class to connect to the Twitter services and fetch the latest statuses for the SitePoint account (obviously, you can substitute yours in its place) and some of the basics like templating and caching. The script uses the REST API since it only needs to fetch, so there's no messing around with the OpenID authentication the Twitter API now requires. You can also download the source for the code that'll be generated during the series.

0 comments voice your opinion now!
twitter widget rest api tutorial series


Matthew Weier O'Phinney's Blog:
Using Action Helpers To Implement Re-Usable Widgets
October 05, 2010 @ 09:12:19

Matthew Weier O'Phinney has a new post to his blog today showing you how to use action helpers to make widgets that you can reuse all over your Zend Framework application. His method doesn't use the "action()" helper, either.

The situation all started when Andries tweeted asking about what he considered some mis-behavior on the part of the action() view helper -- a situation that turned out not to be an issue, per se, but more a case of bad architecture within Zend Framework. [...] The helper was done this way because Zend Framework does not render views a single time -- it instead renders after each action, and accumulates views to render in the layout.

Instead, he offers action helpers as a solution. He gives an example of a user module that has views, helpers and forms but no controllers, including a Bootstrap file. This bootstrap defines the helpers, configuration file and adds the helpers into the process flow of the application. Once things are all set up and the action helper is created, adding the module to a page is as easy as calling "createProfileWidget()" into a partial view.

1 comment voice your opinion now!
action helper zendframework widget reuse tutorial


NETTUTS.com:
How To Build a Widget to Display your Buzzing
April 09, 2010 @ 12:16:50

On NETTUTS.com a tutorial has been posted recently showing you how to build a widget for Buzz, the Google's service similar to Twitter. If you've ever worked with the Twitter timeline concept, using Buzz will feel very familiar. Unfortunately, for the moment at least, it's a read-only kind of thing.

At the moment, there's no API to work with the Buzz service; Google is expected to provide one within the next several months, however, for now, the public updates are available as Atom feeds.

They grab these Atom feeds via a proxy PHP script (can't cross-domain with Ajax, after all) and then some Ajax to real the latest from this proxy. The results are displayed in a (very familiar looking) timeline with the help of the included HTML and CSS/images. The last part of the process is to push it into a jQuery plugin for easier use down the line. You can get the source download here and check out a demo online.

0 comments voice your opinion now!
widget googlebuzz tutorial timeline atom


PHPBuilder.com:
Customize Your WordPress Blog with PHP Plugins and Widgets
March 15, 2010 @ 14:51:34

On PHPBuilder.com today there's a new tutorial walking you through the creation of a simple WordPress plugin that shows the latest YouTube video from your blog's channel.

Think of plugins as components where you put your functionality and widgets as components of your user interface. Building your own WordPress plugins and widgets will make your blog truly original, and all you need is basic PHP and HTML knowledge - and your imagination.

They help you get started with defining a few constants, registering the actions with WordPress, building the widget (with complete cut-and-paste-able code) and including it in your WordPress blog. You can download the complete source if you want to get started quickly.

0 comments voice your opinion now!
wordpress plugin widget tutorial customize


Debuggable Blog:
How to have multiple paginated widgets on the same page with CakePHP
August 26, 2008 @ 12:04:58

On the Debuggable blog Tim Koschutzki shows a way to have more than one paginated item on your page at a time (in a CakePHP application).

Many of you might have run into the problem of having multiple boxes on the same page that need to be paginated. For example you might have a left column with a list of members of your site and a right column that shows for a example a list of forums. Yeah, that's not the best example, but you get the idea.

The typical CakePHP pagination functional assumes that there's only one block of information that needs to be paginated per page. With Tim's modification, the model name for where the data is being pulled from is appended to the end of the URL and parsed by the script to know which is which.

0 comments voice your opinion now!
cakephp pagination widget multiple page


Zend Developer Zone:
Create your own widget with PHP-GTK
August 19, 2008 @ 09:35:30

A new tutorial on the Zend Developer Zone shows you how to use PHP's "younger cousin" PHP-GTK to make a simple widget.

With PHP's younger cousin PHP-GTK's recent step to maturity with the 2.0 stable release it is a good time to give this project some more attention. In this article I will show you how to create a re-usable IPv4 Entry widget using PHP-GTK's excellent OO structure.

The end result is an interface that lets the user input an IP in a familiar way (blocks of three, automatically advancing to the next block). They talk about the code first, describing how all of the parts fit together before giving you an easily cut-and-pastable block of code (the class) that creates the widget.

0 comments voice your opinion now!
widget phpgtk tutorial ipaddress interface



Community Events





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


code framework conference api list symfony series tips language voicesoftheelephpant community interview deployment laravel podcast threedevsandamaybe bugfix introduction zendserver release

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