Rapid Application Development with Open Source Software

Next: Creating a mobile sitemap with CakePHP UP: TOC

In the last chapter we've created a new theme with a layout for mobile devices. In this chapter we will create a mobile view for displaying book chapters.

Please note that you don't need to create a mobile view for each normal view. If a view for a theme does not exist, CakePHP will use the default view without throwing an error. This is very smart and allows you to adopt mobile views step by step.

cd /usr/local/www/logikfabrik.com/cakephp/app/View/Themed/Mobile15/

mkdir Books
cd Books
touch toc.ctp

The content of ..../Books/toc.ctp is as follows.

' . $ta['name'] . '';

    echo '

' . __('This interactive online book contains the following chapters') . '

'; foreach ($ta['cb'] as $c) { echo ''; echo $c['title'] . ''; } } ?>
Next: Creating a mobile sitemap with CakePHP UP: TOC