Posted by mcloide on April 8, 2009
I’m not fond of Ruby on Rails, but this can be a great resource - http://www.rhomobile.com/ – even more today with the hunger for mobile apps becaming every day bigger.
This guys had done a framework that would provide you create a app for multiple smart phones with one single code.
It’s a pretty cool concept and it’s definetly worth to take a look at.
Down side: It’s not PHP, but well, nothing is perfect
Posted in News, development, resources | Tagged: framework, mobile, not php, phone, rhomobile, ruby on rails | 1 Comment »
Posted by mcloide on September 25, 2008
How about you create a version of your WordPress website for Iphone, well here is a small tutorial of how to do it.
All the coding is using the Zend Framework Database Handler, so if you are using one of my classes or anything else, change it to work for you.
The first thing you will need is to download the IUI framework. It have a series of scripts, css, and some other things that are going to be used when you are checking the site with your Iphone.
Now create a PHP script page with this html header. It’s the same one that is being used at the samples of the framework.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>McLoide.com Iphone Version</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css" media="screen">@import "../iui/iui.css";</style>
<script type="application/x-javascript" src="../iui/iui.js"></script>
<!--
<script type="application/x-javascript" src="http://10.0.1.2:1840/ibug.js"></script>
-->
</head>
<body onclick="console.log('action', event.target);">
Now you have to create the following structure:
- Toolbar – will be displayed at top with a back button and the stats (battery, etc) button
- Home – will be the first thing loaded when the Iphone load the page, so this should have a list of the contents of the website
- Summary – This will display a small summary of what’s about the the content that is about to be displayed and a back button
- Display – This will display the full content of the item
Imagine this as a site tree that is being build dinamicaly and every click displays one of the tree branches.
So, how your body will be built? It’s simplier to display the code than explain, so, here’s the rest of the code:
<div class="toolbar">
<h1 id="pageTitle"></h1>
<a id="backButton" class="button" href="#"></a>
<a href="stats.php" class="button">Stats</a>
</div>
<ul id="home" title="Posts" selected="true">
<?php
$stmt = "select * from wp_posts where post_status = 'publish' group by post_title order by ID asc";
$data = $GLOBALS['db']->fetchAll($stmt); # This is using Zend Framework Db Hanlder
foreach($data as $key => $contents) {
?><li><a href="#summary<?php echo $contents['ID'] ?>"><?php echo strip_tags($contents['post_title']); ?></a></li><?php
}
# retrieving all info of your posts
?>
<li><a href="stats.php">Stats</a></li>
</ul>
<?php
#building the summary list
foreach($data as $key => $contents) { ?>
<ul id="summary<?php echo $contents['ID'] ?>" title="<?php echo strip_tags($contents['post_title']); ?>">
<li><a href="#display<?php echo $contents['ID'] ?>"><?php echo count_words(strip_tags($contents['post_content']),20); ?></a></li>
<li><a href="#home">Back</a></li>
</ul>
<?php } ?>
<?php
#building the display blocks
foreach($data as $key => $contents) { ?>
<div id="display<?php echo $contents['ID'] ?>" class="panel" title="<?php echo $contents['post_title']; ?>">
<h2><?php echo $contents['post_title']; ?></h2>
<p><?php
echo $contents['post_content'];
?></p>
</div>
<?php }
#note count_words is just a small function to get an string and correctly break into a smaller string without breaking the words
?>
With this in place all you need to do now is test it and for that you can test it in the Iphone tester. It’s not 100% accurate but it will give you a great idea of how things will work in the real Iphone and you can always access it by your computer browser.
Off course this is a simple example and there is much more you could do to work with this. Imagine a full application only to work out with Iphones.
If you want to see this example working, you can see a demo from in http://www.mcloide.com/iphone/
Have fun.
Posted in Ajax, CSS, PHP, Zend, development, resources | Tagged: Ajax, CSS, first demo, framework, iphone, iUI, PHP, Zend | 1 Comment »
Posted by mcloide on September 17, 2008
Today I decided to take a look into the Iphone Framework and it’s simple to install and work with. The principle is simple, everything is tied up with div’s, ul’s, li’s, links, fieldsets and forms and every wrapper tag carries an ID. The framework will take care of the effects and the way that it will display for the iPhone.
When you donwload the framework you will see some examples, but the best one is the music example. With that one you can create any page that can hold the information that you want to display for the Iphone.
Right now I have just done a small textual application, but I’m working to create a small full application to better explain how the framework works.
Posted in Ajax, CSS, development, resources | Tagged: framework, iphone, iUI | 4 Comments »
Posted by mcloide on September 3, 2008
+
+
= 
I usually do not post a ping back, but this is so well explained that it’s worthed to take a look at. Christoph Dorn has just written a new post in his blog explaining a very cool debug feature from the new Zend Framework.
Try it Out!
You may be used to debugging your ZF code using Zend_Debug::dump() or even var_dump(). What do you have to loose trying these new components? They offer the big advantage of not dumping your debug data to the page. They allow you to debug applications with intricate designs as well as AJAX request that require clean JSON or XML responses.
Check it out: Christoph Dorn Blog
Posted in PHP, Zend, development, resources | Tagged: cool, debug, features, framework, new, PHP, Zend | Leave a Comment »