Next Chapter: Creating a mobile sitemap with CakePHP

Creating a new mobile View for Books

2019-05-13 16:28:36.833928+00

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'] . ''; } } ?>

Tag: cakephp2

Previous Chapter: Creating a Bootstrap Theme for mobile websites

Next Chapter: Creating a mobile sitemap with CakePHP