100% found this document useful (1 vote)
16 views

CodeIgniter for Rapid PHP Application Development Improve your PHP coding productivity with the free compact open source MVC CodeIgniter framework 1st Edition David Upton pdf download

The document is a promotional overview of the book 'CodeIgniter for Rapid PHP Application Development' by David Upton, which focuses on improving PHP coding productivity using the CodeIgniter framework. It includes links to various related resources and other programming books. The book aims to provide a systematic understanding of CodeIgniter's features and practical applications for web development.

Uploaded by

butackenisgu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
16 views

CodeIgniter for Rapid PHP Application Development Improve your PHP coding productivity with the free compact open source MVC CodeIgniter framework 1st Edition David Upton pdf download

The document is a promotional overview of the book 'CodeIgniter for Rapid PHP Application Development' by David Upton, which focuses on improving PHP coding productivity using the CodeIgniter framework. It includes links to various related resources and other programming books. The book aims to provide a systematic understanding of CodeIgniter's features and practical applications for web development.

Uploaded by

butackenisgu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

CodeIgniter for Rapid PHP Application

Development Improve your PHP coding productivity


with the free compact open source MVC
CodeIgniter framework 1st Edition David Upton
download
https://ebookname.com/product/codeigniter-for-rapid-php-
application-development-improve-your-php-coding-productivity-
with-the-free-compact-open-source-mvc-codeigniter-framework-1st-
edition-david-upton/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Multi Tier Application Programming with PHP 1st Edition


David Wall

https://ebookname.com/product/multi-tier-application-programming-
with-php-1st-edition-david-wall/

SOA and WS BPEL Composing Service Oriented Architecture


Solutions with PHP and Open Source ActiveBPEL 1st Ed.
Edition Yuli Vasiliev

https://ebookname.com/product/soa-and-ws-bpel-composing-service-
oriented-architecture-solutions-with-php-and-open-source-
activebpel-1st-ed-edition-yuli-vasiliev/

Building PHP Applications with Symfony CakePHP and Zend


Framework 1st Edition Bartosz Porebski

https://ebookname.com/product/building-php-applications-with-
symfony-cakephp-and-zend-framework-1st-edition-bartosz-porebski/

Dipole Quadrupole Theory of Surface Enhanced Raman


Scattering 1st Edition A.M. Polubotko

https://ebookname.com/product/dipole-quadrupole-theory-of-
surface-enhanced-raman-scattering-1st-edition-a-m-polubotko/
The Healing Echo Discovering Homeopathic Cell Salt
Remedies Schuessler Tissue Salts 1st Edition Vinton
Mccabe

https://ebookname.com/product/the-healing-echo-discovering-
homeopathic-cell-salt-remedies-schuessler-tissue-salts-1st-
edition-vinton-mccabe/

An Introduction to English Phonetics 3rd Edition


Richard Ogden

https://ebookname.com/product/an-introduction-to-english-
phonetics-3rd-edition-richard-ogden/

The Dragon Has Two Tongues Essays on Anglo Welsh


Writers and Writing Glyn Jones

https://ebookname.com/product/the-dragon-has-two-tongues-essays-
on-anglo-welsh-writers-and-writing-glyn-jones/

Taste of Modernity Sufism Salafiyya and Arabism in Late


Ottoman Damascus Itzchak Weismann

https://ebookname.com/product/taste-of-modernity-sufism-
salafiyya-and-arabism-in-late-ottoman-damascus-itzchak-weismann/

Essential App Engine Building High Performance Java


Apps with Google App Engine 1st Edition Adriaan De
Jonge

https://ebookname.com/product/essential-app-engine-building-high-
performance-java-apps-with-google-app-engine-1st-edition-adriaan-
de-jonge/
Ireland For Dummies 4th edition Dummies Travel
Elizabeth Albertson

https://ebookname.com/product/ireland-for-dummies-4th-edition-
dummies-travel-elizabeth-albertson/
CodeIgniter for Rapid PHP
Application Development

Improve your PHP coding productivity with the


free compact open-source MVC CodeIgniter
framework!

David Upton

BIRMINGHAM - MUMBAI
CodeIgniter for Rapid PHP Application Development
Improve your PHP coding productivity with the free compact
open-source MVC CodeIgniter framework!

Copyright © 2007 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: July 2007

Production Reference: 1160707

Published by Packt Publishing Ltd.


32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.

ISBN 978-1-847191-74-8

www.packtpub.com

Cover Image by Vinayak Chittar ([email protected])


Credits

Author Project Manager


David Upton Abhijeet Deobhakta

Reviewers Indexer
Rick Ellis Bhushan Pangoankar
Derek Allard
Proofreader
Development Editor Chris Smith
Douglas Peterson
Production Coordinator
Assistant Development Editor Shantanu Zagade
Nikhil Bangera
Cover Designer
Technical Editor Shantanu Zagade
Ajay S

Editorial Manager
Dipali Chittar
About the Author

David Upton is a director of a specialized management consultancy company,


based in London but working around the world. His clients include some of the
world's largest companies. He is increasingly interested in web-enabling his work,
and seeking to turn ideas into robust professional applications by the simplest and
easiest route. He has so far written applications for two major companies in the UK.
His other interests include simulation, on which he writes a weblog that takes up far
too much of his time, and thinking.

I’d like to thank Rick Ellis for writing CI and for making it available,
free. This spirit of generosity with such valuable intellectual
property is what makes the Open Source movement a success, and
an example to the rest of us.

I’d also like to thank Rick, and Derek Allard, for undertaking a
technical review of the book and making many helpful suggestions.

Mark Barker inspired and helped me to understand Object


Orientation, during many Saturday evening ‘geek-outs’.

Lastly, but not least, my thanks to Julia, John, and James for their
love, support, and patience.
About the Reviewers

Rick Ellis is the founder and CEO of EllisLab.com, the company that develops
CodeIgniter and several other widely used web applications. Rick Ellis has a diverse
background in media technology, having worked in creative and technical capacities
on interactive projects for Disney, to feature films for Oliver Stone, and almost every
kind of web-based project in-between.

Derek Allard is a programmer, author, and award-winning instructor based


in Toronto, Canada. He builds web applications, is a standards and accessibility
supporter, a scripting and database guy, and a PHP junkie. A sought-after educator
and freelancer, Derek spends most of his time working with XHTML, PHP, XML
and JavaScript.

As a highly visible CodeIgniter community member, Derek was hired by EllisLab as


the Senior Technical Support Specialist. He devotes time to ensuring CodeIgniter
and their flagship content management system, ExpressionEngine, remain
market leaders.

He blogs about all things web at www.derekallard.com.


Table of Contents
Preface 1
Chapter 1: Introduction to CodeIgniter 7
What can CodeIgniter Do for You? 7
Save Time 8
Make Your Site More Robust 9
Keep Your Links Up-To-Date Automatically 9
Save Database Crashes: 'prep' Your Data Entry Forms 10
Make Your Code Bolder 11
Send Email Attachments without Hassles 11
Save Bandwidth by Zipping Files That Users Need to Download 12
Yes, But…What is CodeIgniter? What are Frameworks? 12
And Who is That Man? 14
The 'Open Source' Business Model 15
What CI Doesn't Do 16
License 18
Summary 19
Chapter 2: Two Minutes' Work: Setting up a CodeIgniter Site 21
Prerequisites 21
Installing CodeIgniter 22
Exploring the File Structure 23
The Configuration File 24
Does it Work? 25
Summary 25
Chapter 3: Navigating Your Site 27
MVC—Just Another Acronym? 28
The Structure of a CI Site: Controllers and Views 29
The Welcome Controller 31
Working with Views 32
Table of Contents

The Default Controller 33


CodeIgniter Syntax Rules 33
Controller 34
View 34
Types of Files or Classes on a CI Site 34
What are All Those Folders For? 37
Designing a Better View 37
Designing a Better Controller 39
Getting Parameters to a Function 40
Passing Data to a View 41
How CI Classes Pass Information and Control to Each Other 43
Calling Views 43
Calling Functions Directly 43
Interacting with Controllers 44
It's Just Like an Egg-Cup 45
An Example of a CI Helper: the URL Helper 46
A Simple Library Example: Creating a Menu 48
Summary 49
Chapter 4: Using CI to Simplify Databases 51
Configuration Settings 51
Designing the Database for Our Site 52
Active Record 53
Advantages of Using the Active Record Class 54
Saving Time 54
Automatic Functionality 54
Read Queries 56
Displaying Query Results 58
Create and Update Queries 59
Delete Queries 61
Mixing Active Record and 'Classic' Styles 61
Summary 62
Chapter Appendix: MYSQL Query to Set Up 'websites' Database 63
Chapter 5: Simplifying HTML Pages and Forms 67
Writing a View 67
Long and Short PHP Syntax 69
Nesting Views 70
Practical Issues of Site Architecture 73
CI's Form Helper: Entering Data 74
Form Helper Advantage One: Clarity 74
Form Helper Advantage Two: Automation 77

[ ii ]
Table of Contents

My 'Display' Model 78
CI's Validation Class: Checking Data Easily 79
Set Up Validation 80
Set Up the Controller 81
Set Up the Forms 81
Summary 83
Chapter 6: Simplifying Sessions and Security 85
Starting to Design a Practical Site with CI 85
Moving Around the Site 86
Security/Sessions: Using Another CI Library Class 91
Turning Sessions into Security 94
Security 96
Summary 98
Chapter 7: CodeIgniter and Objects 99
Object-Oriented Programming 99
Working of the CI 'Super-Object' 100
Copying by Reference 103
Adding Your own Code to the CI 'Super-Object' 105
Problems with the CI 'Super-Object' 106
Summary 109
Chapter 8: Using CI to Test Code 111
Why Test, and What For? 111
CI's Error Handling Class 113
CI's Unit Test Class 115
When to Use Unit Tests 117
Example of a Unit Test 118
CI's Benchmarking Class 121
CI's Profiler Class 122
Testing with Mock Databases 123
Control and Timing 124
Summary 125
Chapter 9: Using CI to Communicate 127
Using the FTP Class to Test Remote Files 127
Machines Talking to Machines Again—XML-RPC 129
Getting the XML-RPC Server and Client in Touch with Each Other 131
Formatting XML-RPC Exchanges 132
Debugging 134
Issues with XML-RPC? 135
Talking to Humans for a Change: the Email Class 136
Summary 139

[ iii ]
Table of Contents

Chapter 10: How CI Helps to Provide Dynamic Information 141


The Date Helper: Converting and Localizing Dates 142
Working with Text: the Text Helper and Inflector Helper 145
Going International: the Language Class 146
Making HTML Tables the Easy Way: the Table Class 150
Caching Pages 152
Summary 154
Chapter 11: Using CI to Handle Files and Images 155
The File Helper 156
The Download Helper 158
The File Upload Class 160
CI's Image Class 165
Easy File Compression with the CI Zip Class 169
Summary 169
Chapter 12: Production Versions, Updates, and Big Decisions 171
Connections: Check the Config Files 172
URLs 172
Databases 172
Other config Files 173
Look Out for PHP 4/5 and Operating System Differences 173
Diagnostic Tools 174
Coping with Changes in New CI Versions 177
How to Load Models, and What to Call Them 178
How to Initialize Your Own 'library' Classes 179
So Should I Update If a New CI Version Comes Out? 179
How to Add On to CI's Basic Classes 181
Summary 183
Chapter 13: Instant CRUD—or Putting it All Together 185
The CRUD Model: Design Philosophy 186
The Standard Controller Format 187
The Database Tables 189
The Heart of the Model: the Array 189
Function by Function: the CRUD Model 192
Showall 192
Reading the Data 195
Delete and Trydelete 196
Insert 201
Insert2 208
The Test Suite 209
Summary 214

[ iv ]
Table of Contents

Chapter 14: The Verdict on CI 215


Some Code: the 'do_test' Model 216
A Balance Sheet 225
Where CI Helped: Structure 225
Where CI Helped: Simplicity 226
Where CI Helped: Extra Functionality 226
Problems with CI 226
Completeness 227
Ease of Use 227
Summary 228
Chapter 15: Resources and Extensions 229
CI's User Forums 230
Video Tutorials 232
Available Plug-ins and Libraries 232
AJAX/Javascript 233
Authentication 233
External Sites 235
Comparisons: Which Charting Library to Use? 235
CRUD: the Final Frontier 238
Resources for Other Programmes, e.g. Xampplite, MySQL, PHP 239
Summary 240
Index 241

[]
Preface
This book sets out to explain some of the main features of CI. It doesn't cover them
all, or cover any of them in full detail. CI comes with an excellent on-line User Guide
that explains most things. This is downloaded with the CI files.

This book doesn't try to duplicate the User Guide. Instead it tries to make it easier for
you to pick up how the CI framework works, so you can decide whether it is right
for you, and start using it quickly.

In some places, this book goes beyond the User Guide, though, when it tries to
explain how CI works. (The User Guide is more practically oriented.) This means
that there are some fairly theoretical chapters in between the "here's how" pages. I've
found that it helps to understand what CI is doing under the hood; otherwise you
sometimes get puzzling error messages that aren't easy to resolve.

I've tried to use a 'real-world' example when showing sections of CI code. I want
to show that CI can be used to develop a serious website with a serious purpose.
I'm currently running several websites for clients, and I want a program that will
monitor them, test them in ways I specify, keep a database of what it has done, and
let me have reports when I want them.

The examples in this book don't show it in full detail, of course: but they do, I hope,
demonstrate that you can use CI to make pretty well any common coding simpler,
and some uncommon stuff as well.

This book steps you through the main features of CodeIgniter in a systematic way,
explaining them clearly with illustrative code examples.
Preface

What This Book Covers


Chapter 1 explains what CodeIgniter can do, the 'framework', and how CodeIgniter
fits in. It further talks about the open-source business model and gives some
disadvantages of CodeIgniter, at the end.

Chapter 2 explains what happens when you install the site, and which files will be
created. It gives a detailed overview of the required software, and explains the basic
configuration of CodeIgniter.

Chapter 3 explains how MVC helps to organize a dynamic website. It goes further
to explain the process by which CodeIgniter analyzes an incoming Internet request
and decodes which part of your code will handle it. Then CodeIgniter syntax rules
and the different types of files or classes you can find—or write for yourself—on a
CodeIgniter site are explained. At the end of the chapter, some practical hints on site
design are given.

Chapter 4 looks at how you set up a database to work with CodeIgniter, and then
how you use the Active Record class to manipulate the database.

Chapter 5 covers various ways of building views, how to create HTML forms quickly,
and how to validate your forms using CodeIgniter's validation class.

Chapter 6 looks at one of the basic questions affecting any website i.e. session
management and security; we also explore CodeIgniter's session class.

Chapter 7 covers the way in which CodeIgniter uses objects, and the different ways in
which you can write and use your own objects.

Chapter 8 covers CodeIgniter classes to help with testing: Unit tests, Benchmarking,
the 'profiler' and ways in which CodeIgniter helps you to involve your database in
tests without scrambling live data.

Chapter 9 looks at using CodeIgniter's FTP class and email class to make
communication easier, and then we venture into Web 2.0 territory using XML-RPC.

Chapter 10 talks about CodeIgniter classes that help in overcoming problems arising
regularly when you are building a website, for example, the date helper, the text and
inflector helpers, the language class, and the table class.

Chapter 11 looks at several useful CodeIgniter functions and helpers: file helper,
download helper, file upload class, image manipulation class, and the ZIP class.

Chapter 12 covers exploring your config files, using diagnostic tools, and potential
differences between servers, along with some notes on security.

[]
Preface

Chapter 13 shows you how to generalize CRUD operations so that you can do them
with two classes: one for the controller, and one for the CRUD model.

Chapter 14 looks at some coding examples, bringing together a lot of the functions
that have been discussed bit by bit in the preceding chapters.

Chapter 15 looks at some of the resources available to you when you start to code
with CodeIgniter, such as the libraries for AJAX and JavaScript, authentication,
charting, and CRUD.

What You Need for This Book


Throughout this book, we will assume that you have the following packages
installed and available:

• PHP 4.3.2 or above


• A working web server
• One of MySQL, MySQLi, MS SQL, Postgre, Oracle, SQLite, ODBC

Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "We can
include other contexts through the use of the include directive."

A block of code will be set as follows:


$active_group = "default";
$db['default']['hostname'] = "";
$db['default']['username'] = "";
$db['default']['password'] = "";

When we wish to draw your attention to a particular part of a code block, the
relevant lines or items will be made bold:
</head>
<body>
<h1 class='test'><?php echo $mytitle; ?> </h1>
<p class='test'><?php echo $mytext; ?> </p>
</body>

[]
Preface

New terms and important words are introduced in a bold-type font. Words that you
see on the screen, in menus or dialog boxes for example, appear in our text like this:
"clicking the Next button moves you to the next screen".

Warnings or important notes appear in a box like this.

Reader Feedback
Feedback from our readers is always welcome. Let us know what you think about
this book, what you liked or may have disliked. Reader feedback is important for us
to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to [email protected],


making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send
us a note in the SUGGEST A TITLE form on www.packtpub.com or
email [email protected].

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the Example Code for the


Book
Visit http://www.packtpub.com/support, and select this book from the list of titles
to download any example code or extra resources for this book. The files available
for download will then be displayed.

The downloadable files contain instructions on how to use them.

[]
Preface

Errata
Although we have taken every care to ensure the accuracy of our contents, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in text or
code—we would be grateful if you would report this to us. By doing this you can
save other readers from frustration, and help to improve subsequent versions of
this book. If you find any errata, report them by visiting http://www.packtpub.
com/support, selecting your book, clicking on the Submit Errata link, and entering
the details of your errata. Once your errata are verified, your submission will be
accepted and the errata added to the list of existing errata. The existing errata can be
viewed by selecting your title from http://www.packtpub.com/support.

Questions
You can contact us at [email protected] if you are having a problem with
some aspect of the book, and we will do our best to address it.

[]
Introduction to CodeIgniter
Most of us just want to write applications that work well, and to do it as simply and
easily as we can. This book is about CodeIgniter, a tool for making PHP easier to use.

If you need to produce results, if you think that the details and intricacies of coding
are for geeks, then you should look at CodeIgniter (CI to its friends).

CI is free, lightweight, and simple to install, and it really does make your life much
easier. Just read this chapter to find out how:

• What CI can do for you


• What is a 'framework' and how does CI fit in?
• The open-source business model
• Some disadvantages of CI (no, it's not perfect)

What can CodeIgniter Do for You?


If you are already writing code in PHP, CodeIgniter will help you to do it better, and
more easily. It will cut down on the amount of code you actually type. Your scripts
will be easier to read and update. It will help you to give large websites a coherent
structure. It will discipline your coding and make it more robust, in some cases
without you even knowing it.

That's quite a big claim. You have already spent some time learning PHP, HTML,
CSS, a database, and several other acronyms' worth of geek speak. You need a basic,
but not necessarily an expert, knowledge of PHP to benefit from CI.
Introduction to CodeIgniter

CodeIgniter is not for you if:

• You don't have a reasonable knowledge of PHP and HTML.


• You want to write a basic Content Management System (CMS) quickly and
simply, with a minimum of coding. (Look at a product like
Expression Engine.)
• You only want to write simple websites with a few standard features.

Save Time
CI doesn't take long to learn, and it quickly pays for your effort in the time saved
later on. Let's look at a simple measure:

How CI cuts down the amount of code you need to type.

This is not just good for the lazy. The less you type, the fewer mistakes you make,
and the less time you spend debugging your code. The smaller your code is, the
faster it loads and less space it takes up.

Here are two examples (which are explained later on in this book, so don't worry
now about how they work!).

Imagine you are writing a database query. This is how you might write a function
within your PHP programme to query a MySQL database:
$connection = mysql_connect("localhost","fred","12345");
mysql_select_db("websites", $connection);
$result = mysql_query ("SELECT * FROM sites", $connection);
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
foreach ($row as $attribute)
print "{$attribute[1]} ";
}

Now see how a CI function would handle a similar query:


$this->load->database('websites');
$query = $this->db->get('sites');
foreach ($query->result() as $row)
{
print $row->url
}

Compare the character counts: 244 for the traditional syntax; 112 for CI.

[]
Chapter 1

Now let's imagine that you are writing a data entry form in HTML, and you want
a drop-down query box. Let's say this drop-down query box shows three options
and allows the user to select one of them. In HTML, a drop-down box can be created
like this:
<select name="type">
<option value="1">www.this.com</option>
<option value="2">www.that.com</option>
<option value="3" selected>www.theother.com</option>
</select>

CI's version is both shorter and, because it works from an array, more adapted to
PHP processing:
$urlarray = array(
                  '1'  => 'www.this.com',
                  '2'  => 'www.that.com',
                  '3'  => 'www.theother.com',
                );

$variable .= form_dropdown('url', $urlarray, '1');

In HTML, you need to type 154 characters; in CI, 128.

Make Your Site More Robust


Although you don't need to write as much code, CI provides a lot of the standard
functionality for you, and remembers all those oddities and quirks. It keeps track
of things you may have forgotten all about. (Those little touches that distinguish
amateur sites from professional ones…)

Keep Your Links Up-To-Date Automatically


Imagine that you've just written a menu page, with lots of hyperlinks to other pages
in your site. They are all in the traditional HTML format:
<a href="http://www.mysite.com/index.php/start/hello/fred�
">say hello to Fred</a>

Then, you decide to move the site to another URL. That means you have to go
painstakingly through your code, looking for each URL, and re-writing it, or else
none of your links will work.

CI gives you a simple function to write hyperlinks like this:


echo anchor(start/hello/fred, Say hello to Fred);

[]
Introduction to CodeIgniter

CI also encourages you to put the URL of your site in a configuration file that the
rest of your site can access. CI's anchor function that we've used here automatically
refers to that configuration file. So, when you come to move your site, you only
need to change that one entry in the configuration file, and all your hyperlinks
update automatically.

Save Database Crashes: 'prep' Your Data Entry


Forms
Data entry is fraught with problems. Because of limitations of HTML and databases,
data that contain certain symbols— for example, apostrophes and quotation marks—
may cause your database to crash or to give results you did not expect.
The answer to this is to prepare or 'prep' your data in your data entry form, before it
is submitted to the database. All this takes time and a certain amount of extra coding.
CI's form helper does this, automatically. So, when you create an input box by typing:
echo form_input('username', 'johndoe');

You're also getting the hidden benefit of:


function form_prep($str = '')
{
if ($str === '')
{
return '';
}

$temp = '__TEMP_AMPERSANDS__';

// Replace entities to temporary markers so that


// htmlspecialchars won't mess them up
$str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);
$str = preg_replace("/&(\w+);/", "$temp\\1;", $str);

$str = htmlspecialchars($str);

// In case htmlspecialchars misses these.


$str = str_replace(array("'", '"'), array("&#39;",
"&quot;"), $str);

// Decode the temp markers back to entities


$str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
$str = preg_replace("/$temp(\w+);/","&\\1;",$str);

return $str;
}

[ 10 ]
Chapter 1

This is code that handles special characters like '&'; so that they don't cause confusion
while your form is being submitted. As you can see, there is some quite tricky regex
code in there.

Possibly you like typing out regexes. Some people like lying on beds of nails, some
like listening to ABBA; it's a free country. (Well, it is where I'm writing this.) But
if you don't like these things, you can let CI do them for you (the regexes, I mean,
not ABBA), and you needn't even be aware of the code that's working away in the
background for you, every time you write that one simple line of code:
echo form_input('username', 'johndoe');

Make Your Code Bolder


CI also makes it easy to do things you might not have tried before. Of course, PHP
users can always integrate libraries from PEAR and other sources, but these aren't
always easy to integrate, or use, and their syntax and standards differ greatly. CI has
a common set of standards, and once you've mastered its syntax, all its parts work
together without complication. All its code is well-written and reliable, and is tested
out by its user community. It puts much more sophistication in your hands.

Let's look at two examples to illustrate this point.

Send Email Attachments without Hassles


Sending emails is a complex business. CI's code for doing it looks easy to follow:
$this->load->library('email');
$this->email->from('[email protected]', 'Your Name');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();

There are a number of issues involved in sending emails: setting word-wrapping


(and escaping it so long URLs don't get wrapped and broken up) for example, or
sending attachments. The standard PHP functions can get quite complex here, and
the result is that many code writers are tempted to avoid using these functions if
they possibly can.

CI's email class makes it simple to send an attachment. You write:


$this->email->attach('/path/to/photo1.jpg');

CI does the rest. Working behind the scenes, for example, is a function that sorts out
MIME types for nearly hundred different types of attachment. So it knows that
your photo, photo1.jpg,��������������������������������������������������������
is an 'image/jpeg' MIME type. It remembers to generate

[ 11 ]
Introduction to CodeIgniter

boundary delimiters in the right places around your attachments. It takes care of
wrapping your text, and it allows you to easily mark out chunks of text you don't
want wrapped.

Save Bandwidth by Zipping Files That Users Need


to Download
To save bandwidth, it's a fairly common practice to compress or 'ZIP' files before
you download them. That's not something I've ever done, and I wouldn't know how
to go about it. On the other hand, CI has a nice facility that allows you to produce
zipped files with four lines of code:
$name = 'mydata1.txt';
$data = 'the contents of my file…………';
$this->zip->add_data($name, $data);
$this->zip->archive('c:/my_backup.zip');

Run this, and you find a ZIP archive on your C drive containing one file. Your ZIP
filer reader will unzip it and produce the original data for you.

People who use your site won't know that you've produced this impressive result
so easily. They'll be impressed! Your site will save bandwidth. You did it in minutes
rather than hours.

Yes, But…What is CodeIgniter? What are


Frameworks?
Shortly after programming was invented, someone noticed that it involved many
repetitive operations. And shortly after that, someone else—maybe it was Ada
Lovelace, spanner in hand, adjusting Babbage's differential engine, or maybe it was
Alan Turing at Bletchley Park—decided to modularize code, so you only had to
write certain chunks once, and could then re-use them. PHP programmers are used
to writing separate chunks of code in functions, and then storing those functions in
include files.

At one level, a framework is just that: lots of chunks of code, stored in separate files,
which simplify the coding of repetitive operations.

[ 12 ]
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of The Tale of a
Field Hospital
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The Tale of a Field Hospital

Creator: Frederick Treves

Release date: November 21, 2012 [eBook #41432]

Language: English

Credits: Produced by Al Haines

*** START OF THE PROJECT GUTENBERG EBOOK THE TALE OF A


FIELD HOSPITAL ***
Cover
Portrait of Frederick Treves
THE TALE OF A
FIELD HOSPITAL

BY
SIR FREDERICK TREVES, BART.
G.C.V.O., C.B., LL.D.

Late Consulting Surgeon with H.M. Troops in South Africa,


Serjeant-Surgeon to H.M. the King, Author of "The
Other Side of the Lantern," etc.

NEW EDITION

WITH PORTRAIT OF THE AUTHOR


CASSELL AND COMPANY, LTD
London, New York, Toronto and Melbourne
1912

First Published October 1900


Reprinted November and December 1900
February and August 1901
New Edition, November 1911
Preface to New Edition
The South African War, of which this Tale is told, is already near
to be forgotten, although there are many to whom it still remains the
most tragic memory of their lives.
War is ever the same: an arena, aglare with pomp and pageant,
for the display of that most elemental and most savage of human
passions, the lust to kill, as well as a dumb torture place where are
put to the test man's fortitude and his capacity for the endurance of
pain.
This brief narrative is concerned not with shouting hosts in
defiant array, but with the moaning and distorted forms of men who
have been "scorched by the flames of war." It deals with the grey
hours after the great, world-echoing display is over, with the night
that ends the gladiator's show, when the arena is occupied only by
the maimed, the dying and the dead.
It is admitted that in the South African War the medical needs
of the Army were efficiently and promptly supplied. This account
serves to show of what kind is the work of the Red Cross in the field.
It may serve further to bring home to the reader the appalling
condition of the wounded in war when--as in the present campaign
in the Near East--the provision for the care of the sick is utterly
inadequate, if not actually lacking.
FREDERICK TREVES.
THATCHED HOUSE LODGE,
RICHMOND PARK, SURREY.
November, 1912.
Preface to the First Edition
In this little book some account is given of a field hospital which
followed for three months the Ladysmith Relief Column, from the
time, in fact, that that column left Frere until it entered the long-
beleaguered town. The fragmentary record is based upon notes
written day by day on the spot. Some of the incidents related have
been already recounted in a series of letters published in the British
Medical Journal, and certain fragments of those letters are
reproduced in these pages, or have been amplified under
circumstances of greater leisure.
The account, such as it is, is true.
It may be that the story is a little sombre, and possibly on
occasions gruesome; but war, as viewed from the standpoint of a
field hospital, presents little that is cheery.
It appears that some interest might attach to an account of the
manner in which our wounded faced their troubles, and of the way
in which they fared, and under the influence of that impression this
imperfect sketch has been written.

CONTENTS

CHAPTER

1. The Field Hospital


2. Frere Camp
3. The Hospital Dog
4. The Morning of Colenso
5. The Hospital under the Ridge
6. Inside an Operation-Tent
7. The Surgeons of the Field Hospitals
8. A Professional Visit by Rail
9. The Hospital Train at Colenso
10. The Nurses at Chieveley
11. Some Traits in the Men
12. The Sign of the Wooden Cross
13. The Men with the Spades
14. The Marching
15. Spearman's Farm
16. The Hospital at Spearman's
17. The Two White Lights
18. After Spion Kop
19. The Story of the Restless Man
20. "Did We Win?"
21. The Fighting Spirit
22. The Body-Snatchers
23. Seeing Them Off
24. A Funeral at Spearman's
25. Absent-Mindedness
26. At Chieveley Again
27. A Journey to Ladysmith
28. A Straggler
29. How a Surgeon Won the Victoria Cross
30. "SIC TRANSIT GLORIA MUNDI"
THE TALE OF
A FIELD HOSPITAL

I
THE FIELD HOSPITAL

The Field Hospital, of which some account is given in these pages,


was known as "No. 4 Stationary Field Hospital." The term
"stationary" is hardly appropriate, since the Hospital moved with the
column, and, until at least the relief of Ladysmith, it followed the
Headquarters' camp. The term, however, serves to distinguish "No.
4" from the smaller field hospitals which were attached to the
various brigades, and which were much more mobile and more
restless.
At the commencement of the campaign the capacity of the
Hospital was comparatively small. The officers in charge were Major
Kirkpatrick, Major Mallins, and Lieutenant Simson, all of the Royal
Army Medical Corps. These able officers--and none could have been
more efficient--were, I regret to say, all invalided as the campaign
progressed.
Before the move was made to Spearman's Farm the Hospital
was enlarged, and the staff was increased by the addition of eight
civil surgeons. It is sad to report that of these two died in the camp
and others were invalided. No men could have worked better
together than did the army surgeons and their civilian colleagues.
The greatest capacity of the Hospital was reached after the
battle of Spion Kop, when we had in our tents about 800 wounded.
Some account of the nurses who accompanied the Hospital is
given in a section which follows.
The Hospital was well equipped, and the supplies were ample.
We carried with us a large number of iron bedsteads complete with
mattresses, blankets, and sheets. These were all presented to the
Hospital by Mr. Acutt, a generous merchant at Durban. It is needless
to say that they proved an inexpressible boon, and even when the
Hospital had to trust only to ox transport, all the bedsteads went
with it.
The ladies of the colony, moreover, worked without ceasing to
supply the wounded with comforts, and "No. 4" had reason to be
grateful for their well-organised kindness.
The precise number of patients who were treated in the
Hospital is no doubt recorded in the proper quarter, but some idea of
the work accomplished may be gained from the fact that practically
all the wounded in the Natal campaign--from the battle of Colenso to
the relief of Ladysmith--passed through No. 4 Stationary Field
Hospital. The exceptions were represented by the few cases sent
down direct by train or ambulance from the smaller field hospitals.

II
FRERE CAMP
It was from Frere Camp that the army under General Buller started
for the Tugela River, and the Hospital pitched its tents in that camp
on the evening of Monday, December 11th, 1899. We went up from
Pietermaritzburg by train. The contents were soon emptied out on
the line, some little way outside Frere Station, and close to the
railway the Hospital was put up. That night we all slept under
canvas--many for the first time--and all were well pleased that we
had at last arrived at the front.
Frere is merely a station on the line of rail which traverses
Natal, and as it consists only of some three or four houses and a few
trees it can hardly be dignified by the name of hamlet. Frere is
simply a speck--a corrugated iron oasis--on the vast undulating
plains of the veldt. These plains roll away to the horizon, and are
broken only by kopjes and dongas and the everlasting ant-hills.
On the way towards Ladysmith are a few kopjes of large size,
from any one of which the line of the Tugela can be seen, with the
hills beyond, occupied by the Boer entrenchments, and over them
again the hills which dominate Ladysmith. On the way towards
Estcourt winds a brown road, along which an endless train of ox-
wagons rumble and are lost in the wilderness of the camp.
The river which is reputed to "run" through Frere has long since
ceased to run. The water is retained by certain dams, and the pools
thus formed are uninviting. The water is the colour of pea-soup, and
when in a glass is semi-opaque and of a faint brownish colour. The
facetious soldier, as he drinks it, calls it "khaki and water."
In the lowest pool, immediately above the iron railway bridge
which has been blown up by the Boers, Tommy Atkins bathes with
gusto in what is seemingly a light-coloured mud. Here also he
washes his socks and his shirts.
The centre of the camp is the railway station, and that of Frere
is the smallest and most unpretending that any hamlet could
pretend to. It is, however, crowded out of all reason, and its
platform of hard earth is covered with boxes and baggage and sacks
and saddles in as much disorder as if they had been thrown in panic
from a burning train. Between the little goods shed and the little
booking-office are several stands of rifles. A sentry, proud apparently
in his covering of dust, is parading one end of the platform, while at
the other end a motley crowd of perspiring soldiers are filling water-
bottles at the tank which supplies the engine. In the waiting-room a
tumbled mass of men are asleep on the floor, while on a bench in
front of it two men-of-war's men are discussing an English paper six
weeks old.
Outside the station are ramparts of provision boxes and cases of
ammunition, and iron water cisterns and mealie bags, and to the
fragments of a railing which surrounds the station horses, of all
kinds and in all stages of weariness, are tied.
A ragged time-table on the wall, dealing with the train service to
Pretoria, and with the precise hour of the arrival of the trains there,
seems but a sorry jest. The stationmaster's house has been looted,
and the little garden in front of it has been trampled out of being,
save for two or three red geraniums which still bloom amidst the
dirt. This house is, for the time, the general's headquarters, and
before it waves the Union Jack.
When we reached the camp it was stated that 30,000 men were
under canvas. A camp of this size must of necessity present an
endless scene of bustle and movement. Nothing seemed at rest but
the interminable array of white tents and the rows of baggage
wagons. Cavalry would be moving in one direction and infantry in
another. Here a mounted patrol would be riding out or a couple of
scouts coming in. There would be a long line of Kaffirs carrying bales
and boxes to a temporary depot, and here a troop of eager horses
hurrying to the river to drink. Gallopers would be seen in all
directions, and everywhere would be struggling teams of oxen or of
mules enveloped in clouds of dust and urged on by sweating men
and strange oaths, and by the shrill yells of the Kaffir drivers, whose
dust-dried throats gave out noises like the shrieks of parrots.
There was no shade of any kind, and the camp during the day
lay dry, dusty, parched and restless under a blazing sun, but at night
there was a cool wind and cheery camp fires, and a darkness which
blotted out the dusty roads, the dried-up river, the dismal piles of
stores, and the general picture of a camp in a desert of baked earth.
Every night a search-light was at work sending dispatches to
Ladysmith, and almost every morning could be heard the Boer guns
thundering over that unhappy place.
The British soldier looked very smart in his khaki suit when
embarking at Southampton, but at Frere he showed the effects of
wear, and his tunic, his belt, his pouches, his boots and his face, had
all toned down to one uniform tint of dirt colour. He was of the earth
earthy. He was unshaven. His clothes had that abject look of want of
"fit" that is common to clothes which have been slept in, which have
been more than once soaked through, and which have more than
once dried upon the body of the owner.
III
THE HOSPITAL DOG

Prominent among the personnel of the Hospital should be placed


"Durban," the Hospital dog. He was a brindled bull terrier of
exceptional physique and intelligence, and the story about him was
that he was a refugee dog who had attached himself to "No. 4" at
Durban, and that for want of a better name he had been called after
that pleasant town.
He had a great love of adventure, and fell into the life of a
moving camp with gusto. His good temper and his placid
appreciation of a practical joke were among his many excellent
qualities. When the orderlies were paraded on the platform of
Pietermaritzburg Station, previous to their being entrained for Frere,
"Durban" took his place in the ranks with no little dignity.
The orderlies were devoted to him and he to them, and I have
no doubt that, pampered and humoured in every canine whim, he is
with the Hospital still.
"Durban" had had a special collar made for him on which was
emblazoned the red cross and the name of his company. Just before
starting for Chieveley his particular master made him a pair of
putties, in which his fore legs were enveloped. He was uncommonly
pleased with these embarrassing articles of clothing, and was never
tired of going round the camp to show them to his many admirers.
At Spearman's he was provided with a travelling kit, consisting of a
waterproof cape with two minute panniers on either side, marked
with the red cross, and furnished with unappreciated surgical
dressings. This exquisite outfit was with difficulty secured in position,
and in the early stages of a march was sure to be found dangling
beneath "Durban's" ample chest.
His passion for bathing was only equalled by his passion for
catching flies, and when we reached the Lesser Tugela he would join
party after party on their way to the river, and would bathe as long
and as often as he found anyone to bathe with.
He was useful, too, as a watch-dog, and performed no mean
services in connection with the commissariat department. Some
sheep were given to the Hospital, and for a day or two it was a
problem as to how advantage could be taken of this important
supply of food. The sheep, when wanted for the kitchen, could not
be caught, and could not be shot, and so "Durban" was appealed to
in the difficulty. Accompanied by the cook, on certain mornings
"Durban" made his way to the little flock out on the veldt, and never
failed to pull down a sheep. He followed the cook and the sheep
back to the camp with the air of one who deserved well of his
country.

IV
THE MORNING OF COLENSO

At daybreak on the morning of December 15th the Field Hospital


was already astir. While it was yet dark the silence of the camp was
broken in upon by the rousing of the orderlies, by much slapping
upon the sides of silent tents, by much stumbling over darkened tent
ropes, and by sudden calls of "Get up, you chaps," "Tumble out,"
"Chuck yourselves about." "Why don't you wake a man up?" cries
out one peevish voice among the recently roused. "Why don't you
make a noise?" says another in sleepy tones. "Is the whole camp
afire and is the Boers on us, or is this your idea of calling a
gentleman?" mutters a sarcastic man, as he puts his head out of the
fly of his tent.
In a few minutes everyone in the camp is on the move, for
there is little needed to complete a toilet beyond the tightening of a
belt and the pulling on of a pair of boots. All are in the best of
spirits, and the collecting together of goods and chattels and the
preparing of a hurried breakfast proceed amidst infinite chatter and
many camp pleasantries. We are at last on the move. We are the
last to go. This is the day of the long expected battle, and we are to
push on to the front. The real fighting is to begin, and there is not a
man who is not possessed by the conviction that the Boers will to-
day be swept from the Tugela--if they have not already fled--and
that General Buller will have a "walk over."
One cannot but be reminded, many times since, that the
advance to Ladysmith was always spoken of as a "walk over."
Moreover, everyone is glad to leave Frere--dreary, sweltering
Frere. Since the column left it has become a waste of desolation; the
very grass has been already worn away, and there is nothing but an
expanse of bald earth, scarred with the landmarks of a camp that
was, glistening with empty meat and biscuit tins which flash in the
sun, and dotted over with a rabble of debris. The picturesque cavalry
camp, with its rows of restless horses, is now only indicated by more
or less formal lines of dirtier dirt. The avenues and squares of white
tents are gone, and in their place is a khaki waste covered with the
most melancholy of refuse.
At the outskirts of great towns there is usually, in a place or
two, a desert plot of land marked off by disreputable relics of a
fence and trodden into barren earth by innumerable untidy feet. If
such a plot be diversified with occasional ash heaps, with derelict
straw, and with empty tins and bottomless pots and pans, it will
represent in miniature the great camp of Frere after the column had
moved to the river.
Frere was indeed no longer Frere. It had become suddenly
quiet, and the depressed garrison left behind were almost too listless
to watch, with suitable jealousy, our preparations for departure.
On this particular morning the sun rose gloriously. Out of the
gloom there emerged rapidly the grey heights of the far-off
Drachenbergs, and as the light of the dawn fell full upon them, their
ashen precipices and pinnacles became rose-coloured and luminous;
and the terraces of green which marked the foot of each line of
barren cliff seemed so near and so strangely lit that many a man,
busy in the work of striking camp, stopped to gaze on these
enchanted mountains. The whole range, however, looks chilled and
barren--as barren, as solitary, as unearthly as the mountains of the
moon.
Before the peaks of the Drachenbergs were well alight the boom
of our great guns sounded with startling clearness, and it was
evident that the prelude for the battle had begun.
In due course a train of goods wagons backed down to the side
of the hospital. The tents and countless panniers, boxes, sacks, and
miscellaneous chattels of the hospital were packed upon the trucks.
Our instructions were to proceed by train to Colenso, and to there
unload and camp. There was apparently no doubt but that the
village by the Tugela would immediately be in our hands. Early
rumours reached us, indeed, that the Boers had fled, and that no
living thing was to be seen on the heights beyond the river. These
rumours were soon to be discredited by the incessant roar of
cannon, and later by the barking of the "pom-pom" and the minor
patter of rifle firing.
Four nurses were to go with the train: the two who had
accompanied me from London, Miss McCaul and Miss Tarr, and two
army sisters from Netley, Sister Sammut and Sister Martin.
While the train was being loaded the nurses waited at the hotel
or store. The hotel, a little unpretending bungalow, represented one
of the three or four dwellings which made up the settlement of
Frere. It was kept by Mr. and Mrs. Wilson, to whose hospitality we
were, on this and other occasions, much indebted. Mr. Wilson and
his family were excellent representatives of the many sturdy and
loyal colonists who are to be found throughout Natal. When the
Boers approached Frere they were compelled to fly to the south, and
when they returned to what had once been a home, they found such
a wreck of a house as only Boers can effect. Everything had been
looted that could be looted, and what could not be removed had
been ruthlessly broken up. Even the books in the ample book-case
had been torn to pieces. The empty rooms were filled with filth and
wreckage, and nothing had escaped the obscene hands of these
malicious marauders. Every cupboard had been torn open and, if
possible, torn down; every drawer had been rifled of its contents;
and on the floor, among fragments of broken chairs and crockery
and discarded articles of clothing, would be found a photograph of a
child, trampled out of recognition, or some small keepsake which
had little value but its associations. The Boers, indeed, do not stop
at mere looting, but mark their visits by fiendish malice and by a
savage mischievousness which would not be unworthy of an escaped
baboon.
The train carrying the hospital and its possessions moved on to
Frere Station, where it took up the equipment of officers and men.
There was a passenger carriage with one compartment in which
were accommodated the nurses and three others. The officers,
sergeants, and orderlies rode on the piles of baggage which filled
the open trucks.
The day was blazing hot, and thirst proportionate. The heat
oppressed one with the sense of something that had weight. Any
breeze that moved was heavy with heat.
At last we started for the actual front, full of expectancy and in
the best of spirits. The distance to Chieveley is about seven miles
across the veldt, across the trestle bridge, and past the wreck of the
armoured train. The train moved up the incline to Chieveley very
slowly, and as we approached the higher ground it struck us all that
the incessant artillery and rifle firing, and the constantly repeated
crack of the "pom-pom," were hardly consistent with the much-
emphasised "walk-over."
Outside Chieveley Station, the station of which we were to see
so much later on, the crawling train stopped, and a galloper came up
with a message requesting me to go down to the battlefield at once.
At the same time, Major Brazier-Creagh, who was in charge of the
hospital train, and who was always as near the front as he could get,
came up and told us that things were going badly at Colenso, that
we had lost several guns, and that the wounded were coming in in
scores.

V
THE HOSPITAL UNDER THE RIDGE

My wagon and mules were already at Chieveley when the train


reached that place, and I was able to start for the scene of action
without a moment's delay.
From Chieveley the grass-covered veldt slopes evenly to the
Tugela and to Colenso village, which lies upon its southern bank.
This slope, some few miles from Chieveley, is broken by a long ridge,
upon which the 4.7 naval guns were placed. From this ridge the
whole battlefield could be viewed.
Under the shelter of the ridge, and close to the great guns, four
little field hospitals were pitched, and here I made my first
acquaintance with the circumstances of war. Each field hospital
would be represented by a small central marquee, which formed an
operating and dressing station, and a number of bell tents around it,
which would accommodate in all about one hundred patients.
When I arrived the ambulances were already coming in--the
dreary ambulances, each one with a load of suffering, misery, and
death! Each wagon was drawn by ten mules and driven by a Kaffir,
and over the dusty hood of each the red cross flag waved in the
shimmering heat. They came along slowly, rocking and groaning
over the uneven veldt like staggering men, and each drew up at one
or other of the little hospitals under the ridge. Every ambulance
carried a certain number of wounded men who were well enough to
sit up, and a smaller number who were lying on stretchers--the
"sitting up" and "lying down" cases, as they were respectively called.
Those who could move themselves were soon helped down from the
wagon by willing hands, while the stretchers were taken out by
relays of trained bearers.
What a spectacle it was! These were the very khaki-clad soldiers
who had, not so long ago, left Waterloo, spick and span, amid a
hurricane of cheers, and now they were coming back to camp silent
and listless, and scarcely recognisable as men. They were burnt a
brown red by the sun, their faces were covered with dust and sweat,
and were in many cases blistered by the heat; their hands were
begrimed; some were without tunics, and the blue army shirts they
wore were stiff with blood. Some had helmets and some were bare-
headed. All seemed dazed, weary, and depressed.
Their wounds were of all kinds, and many had been shot in
more places than one. Here was a man nursing a shattered arm in
the blood-stained rags of a torn-up sleeve. There was another with
his head bandaged up and his face painted with black streaks of
dried blood, holding a crushed helmet beneath his arm like a
collapsible opera hat.
Some still gripped their rifles or dragged their bandoliers along
as they limped to the tents. Many were wandering about aimlessly.
All were parched with thirst, for the heat was extreme. Here a man
with a bandaged, bootless foot would be hopping along with the aid
of his gun, while another with his eyes covered up would be clinging
to the tunic of a comrade who could see his way to the tents. One or
two of those who were lying on the ground were vomiting, while
near by a poor fellow, who had been shot through the lung, was
coughing up blood.
All around the operation-marquee men were sitting and lying on
the ground, waiting for their turn at the surgeon's hands; while here
would be a great heap of dusty rifles, and there a pile of discarded
accoutrements, tunics and boots, and elsewhere a medley of boxes,
panniers, canteen tins, cooking pots, and miscellaneous baggage. A
few helmets were lying about which had probably dropped off the
stretchers, or had been removed from the dead, for some of them
were blood-stained and crushed out of shape, or riddled with holes.
The saddest cases among the wounded were those on the
stretchers, and the stretchers were lying on the ground everywhere,
and on each was a soldier who had been "hard hit." Some of those
on the stretchers were already dead, and some kindly hand had
drawn a jacket over the poor, dust-stained face. One or two were
delirious, and had rolled off their stretchers on to the ground; others
were strangely silent, and at most were trying to shade their eyes
from the blinding sun. One man, who was paralysed below the waist
from a shot in the spine, was repeatedly raising up his head in order
to look with persisting wonder and curiosity at limbs which he could
not move and in which he could not feel. Here and there groups of
dusty men, who had been but slightly wounded, were sitting on the
ground together, too tired and too depressed even to talk, or at most
muttering a word or two now and then in a whisper.
Overworked orderlies were busy everywhere. Some were
heating water or soup over the camp fires; others were hurrying
round to each wounded man with water and bread. The majority
were occupied in helping the injured to the tents or were concerned
in attempting to relieve those who seemed in most distress.
The surgeons in their shirt-sleeves were working for their lives.
Some were busy in the operation-marquee, while others were going
from man to man among the crowd upon the ground, giving
morphia, adjusting limbs, and hurrying each of the wounded into the
shelter of a tent with as much speed as possible. Yet, although the
whole ground seemed covered with stricken men, the dismal
ambulances were still crawling in, and far over the veldt the red
cross flag of other wagons could be seen moving slowly up to the
naval ridge.
Would this procession of wagons never end!
Besides the ambulances there was the Volunteer Bearer
Company, organised by Colonel Gallwey, C.B. The men of this
Company were now tramping in in a long, melancholy line made up
of little groups of six slowly moving figures carrying a stretcher
between them, and on each stretcher was a khaki mass that rocked
as the stretcher rocked, and that represented a British soldier badly
wounded, possibly dying, possibly dead.
Above the hubbub of the swarming hospitals was still to be
heard the boom of the accursed guns.
In the rear the whistle and puff of a train at Chieveley sounded
curiously out of place, and about the outskirts of the hospital some
outspanned oxen were grazing as unconcernedly as if they were
wandering in a meadow in England. Over all was the blazing sun and
the blinding sky.
Late in the afternoon a thunderstorm passed overhead, and
when the rain came down the wounded, who were lying on the
grass, were covered over with the waterproof ground-sheets which
were used in the tents. This did little to mitigate the grimness of the
occasion. There was, indeed, something very uncanny in the
covered-up figures, in the array of tarpaulins glistening with rain,
and beneath which some of the wounded lay motionless, while
others moved uneasily.
No pen, however, can fitly describe this scene at the foot of the
ridge. Here was a picture of the horrors of war, and however
accustomed an onlooker may have been to the scenes among which
a surgeon moves, few could have wished other than that the
circumstances of this day would be blotted out of all memory. I
could not fail to be reminded over and over again of the remark
made by many who were leaving England when I left to the effect
that they hoped they would reach the Cape "in time for the fun."
Well, we were in time, but if this was "fun" it was humour of a kind
too ghastly for contemplation.
If of this dismal scene there was much to be forgotten, there
was at least one feature which can never be forgot, and that was the
heroism with which the soldier met his "ill luck." The best and the
worst of a man, so far as courage and unselfishness are concerned,
come out when he is hard hit, and without doubt each one of the
wounded at Colenso "took his licking like a man." Bravery in the heat
and tumult of battle is grand enough, but here in the dip behind the
gun hill, and within the unromantic lines of a field hospital, was a
display of grim pluck, which showed itself only in tightened faces,
clenched teeth, and firmly knit fingers. Among the stricken crowd
who had reached the shelter of the hospital there was many a
groan, but never a word of complaint, never a sign of whining, nor a
token of fear. Some were a little disposed to curse, and a few to be
jocular, but they all faced what had to be like men.
They were not only uncomplaining and unselfish, but grateful
and reasonable. There was no grumbling (no "grousing," as Tommy
calls it), no carping criticism. As one man said, pointing to the over-
worked surgeons in the operation-tent, "They will do the best they
can for the blooming lot of us, and that's good enough for me."

VI
INSIDE AN OPERATION-TENT

There were four operation-marquees pitched under the naval ridge


on the day of Colenso, one connected with each of the field
hospitals. There is little about these marquees or about the work
done in the shadow of them that is of other than professional
interest. They were crowded, and overcrowded, on December 15th,
and the surgeons who worked in them worked until they were
almost too tired to stand. Every preparation had been completed
hours before the first wounded man arrived, and the equipment of
each hospital was ample and excellent. To my thinking, a great
surgical emergency, great beyond any expectation, was never more
ably met than was this on the day of the first battle.
The marquee is small. It accommodates the operation-table in
the centre between the two poles, while along the sides are ranged
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like