(Ebook) CodeIgniter for Rapid PHP Application Development: Improve your PHP coding productivity with the free compact open-source MVC CodeIgniter framework! by David Upton ISBN 9781847191748, 1847191746 instant download
(Ebook) CodeIgniter for Rapid PHP Application Development: Improve your PHP coding productivity with the free compact open-source MVC CodeIgniter framework! by David Upton ISBN 9781847191748, 1847191746 instant download
https://ebooknice.com/product/pemrograman-web-dengan-menggunakan-php-
dan-framework-codeigniter-38383540
https://ebooknice.com/product/pro-php-8-mvc-model-view-controller-
architecture-driven-application-development-32578950
(Ebook) Web Application Development with Yii and PHP Second Edition by
Desconocido
https://ebooknice.com/product/web-application-development-with-yii-
and-php-second-edition-43137684
https://ebooknice.com/product/practical-flutter-improve-your-mobile-
development-with-googles-latest-open-source-sdk-52955310
(Ebook) PHP Application Development with NetBeans by M A Hossain Tonu
ISBN 9781849515801, 1849515808
https://ebooknice.com/product/php-application-development-with-
netbeans-34782830
https://ebooknice.com/product/multi-tier-application-programming-with-
php-1021698
https://ebooknice.com/product/core-web-application-development-with-
php-and-mysql-21995764
https://ebooknice.com/product/soa-and-ws-bpel-composing-service-
oriented-architecture-solutions-with-php-and-open-source-
activebpel-4541334
https://ebooknice.com/product/php-5-cms-framework-development-2nd-
edition-2430200
CodeIgniter for Rapid PHP
Application Development
David Upton
BIRMINGHAM - MUMBAI
CodeIgniter for Rapid PHP Application Development
Improve your PHP coding productivity with the free compact
open-source MVC CodeIgniter framework!
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.
ISBN 978-1-847191-74-8
www.packtpub.com
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
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.
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.
[ 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
[ iv ]
Table of Contents
[]
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
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.
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."
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".
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.
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.
[]
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:
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.
Exploring the Variety of Random
Documents with Different Content
erected when times grew somewhat settled,—it would have been
little use building up a church which at any time could be destroyed
by marauders. Now as Botolph was a Saxon Saint this church must
have been built after the Danes had become Christian, but before
the Norman Conquest. In St. Botolph’s honour the old town of
Icanhoe changed its name to Botolphstown, or Boston.
Beyond the church are certain inns for the convenience of
travellers; among them the “Nuns” Inn. By this way come all the
travellers and the waggons out of Essex, the garden of England. In
the broad courtyard of the inns stand for safety the covered
waggons laden and piled high, to be driven to market in the
morning. About a hundred yards beyond the gate stands Aldgate
Bar, corresponding to the later turnpike. There are other bars which
mark the bounds of the City liberties, but the distance from each
gate is not always the same. Temple Bar, for instance, is a long way
beyond Ludgate; Aldersgate Bar is near the north end of Aldersgate
Street; Bishopsgate Bar is near the Prior’s Almshouse, Norton
Folgate. Along the broad grassy track beyond Aldgate Bar stands a
small white chapel, that of St. Mary Matfelon, and there are already
a few houses, but not many. Beyond Aldgate and before Bishopsgate
the wall runs in a northwesterly direction; on the opposite bank of
the ditch there are certain small tenements. At this point the ditch is
called Houndsditch, because, it is said, “dead dogs are thrown in
here.” But dead dogs are thrown into other ditches as well. People
do not carry a dead dog to this part of the wall in order to throw it
into the ditch, so that this derivation does not ring true. Houndsditch
was probably so named from the kennels standing on the north side
—“dog-houses” they are called by the people. The breeding of dogs
for the hunt is a very important branch of trade; it can only be
carried on in the open country outside the wall of the City. A low wall
has been erected on the north side of the ditch to prevent the
shooting of rubbish into it, but, apparently, without effect. Beyond
the wall the broad stretch of fields belongs to the Priory of the Holy
Trinity.
The next gate is Bishopsgate, the most stately of all the London
gates. The Bishop after whom it is named is Bishop Erkenwald (cons.
675, d. 693), perhaps because he rebuilt or repaired its predecessor.
Not exactly on this spot, but very near to this spot, on the east,
stood the Roman gate of which these are the successors. The
foundations of this original gate have been found in Camomile
Street. There is a row of Almshouses at Bishopsgate Bars for poor
bedridden folk, who are provided with a roof at least, while they beg
their bread of passers-by.
If we remember that Newgate was also rebuilt some distance
south of its original position, we shall find strong confirmation of the
theory that London was for a while a deserted City. For it is
impossible that the occupation of a City should be continuous if the
old position of the gates is forgotten. Nor is it only the site of the
gates itself which is concerned; the change of position of a gate
means the destruction and the obliteration of the old streets in the
City which led to it; also of the roads outside which led to it: it
means total oblivion of the former position of houses and streets. All
this is meant by the transference of a gate. As for the date of the
transference, we have the tradition which makes the good Bishop
Erkenwald the builder; we have, close by the gate, the Church of St.
Ethelburga, who was the Bishop’s friend. On the other hand, Alfred
found the wall in a ruinous condition and strengthened it. Perhaps it
was he who built the gate. The actual gate before which we are
now, in imagination, standing, was erected in 1210, and succeeded
that built by either Alfred or Erkenwald. The two stone images of
Bishops on the south side of this represent St. Erkenwald and
William the Norman; the other two images are those of Alfred and
his son-in-law Ethelred, Earl of Mercia.
Outside this gate we observe a second church dedicated to St.
Botolph, and opposite the church one of the great inns which are
found outside every City gate. This is the “Dolphin.” The broad road
outside leads past the poverty-stricken House of St. Mary of
Bethlehem, now reduced to two or three Brethren, through an
almost continuous line of houses as far as the noble and beneficent
foundation of St. Mary Spital, whither the sick folk of London are
brought by hundreds to lie in the sweet fresh country air outside the
foul smells of the City. The road leads also to Holywell Nunnery on
the west, and as far as the little church of St. Leonard Shoreditch,
lying among the gardens and the orchards. At the east end of the
road is a great field, “Teazle Field,” where they used to cultivate
teazles for the clothmakers: at the time we are considering it is the
place where the crossbow-men shoot for prizes. In Lollesworth Field,
behind St. Mary Spital, there was formerly a Roman cemetery: many
evidences of the fact have been found.
Leaving Bishopsgate and walking along the straight line of wall
running nearly east and west we look out upon the open moor. It is
dotted by ponds and intersected by sluggish streams and ditches;
there are kennels belonging to the City Hunt and to rich citizens, and
all day long you can hear the barking of dogs. There is a stretch of
moorland, waste and uncultivated, covered with rank grass and
weeds and reeds and flowers of the marsh, which is an area of
irregular shape, roughly speaking, 400 yards from east to west by
300 yards from north to south. Any buildings erected here must
stand upon piles driven into the London Clay. There is talk about the
construction of a postern opening upon the moor and of causeways
across the moor. These would be of great convenience to people
wishing to go across to Iselden, or upon pilgrimage to Our Lady of
Muswell Hill or Willesden. There is already a causeway leading from
Bishopsgate Street without to Fensbury Court, where there was a
quadrangular house with a garden and a pond belonging to the
Mayor; and here are the kennels for the “Common Hunt.” Houses
now become thicker outside the wall; and when we reach
Cripplegate we find there is a considerable suburb, with a church
called after St. Giles. It was built two hundred years ago in the reign
of Henry I., so that, as far back as the twelfth century, there was at
least the beginning of a suburb at this place.
As to the first building of Cripplegate there has been a good deal
of conjecture. Since the church was founded about the year 1090, it
is certain that there must have been, even then, a postern at least
for communication between the City and this suburb. And since the
name Cripplegate has nothing to do with any cripples but means
small—“crepul”—gate, the name seems to point to existence of a
postern at first. The gate, whoever built it originally, has been
already rebuilt; once in 1244 by the Brewers—perhaps they changed
it from a postern to a gate—who also constructed rooms above,
which serve for the imprisonment of debtors. You may see one at
the barred window, holding a string with a cup at the end of it, for
the charity of pitiful persons. Put in it a penny for the poor debtors. I
think, from the appearance of the gate, that it will have to be
repaired again before long.
Here the wall bends suddenly to the south by west, running in
that direction for 850 feet. Then it turns sharply to the west and
after a little to the south again. Why did it take this sudden bend?
There has never been anything in the nature of the ground to
necessitate any such turn: there is neither stream, nor lake, nor
rock, nor hill, in the way. Outside the wall, when it was first put up,
there was moorland at this spot as all along the north, yet there
must have been some reason. I have already ventured to offer a
suggestion, which I repeat in this place, that this is the site of the
Roman amphitheatre.
Just beyond the turn of the wall we come to Aldersgate. There
appears to be no tradition concerning the date of this gate. It was
one of the first four gates of the City; and it has been enlarged by
the addition of a great framework house on the south side, and
another on the east side, the latter of which is remarkable for the
possession of a very deep well within its walls. Outside the gate is
yet another church of St. Botolph. Beyond the church you may
observe the modest buildings of a Fraternity. It is an Alien House
called the Brotherhood of St. Fabian and St. Sebastian. Beyond the
House of this Brotherhood are two or three great houses belonging
to nobles. The cluster of religious houses in this neighbourhood may
account for the number of houses which very early began to grow
up around them. Under the wall is the Hospital of St. Bartholomew;
beyond the Hospital is the Priory; beyond the Priory is the House of
the Carthusian Friars; and on the west of these are the houses of
the Knights Hospitallers and the Clerkenwell Nuns. Standing on the
wall we command an excellent view of these buildings: grouped
about in picturesque beauty, they stand among trees and gardens;
beyond them, close to the City wall, lies the level plain of Smithfield
with its trees and ponds, with its Horse Fair and its Cloth Fair, with
its race-course and its gibbet, the place of amusements, the place of
executions, the place of ordeal.
Beyond Aldersgate the wall runs west for a little, when it turns
south again and passes Newgate. This is a goodly and a strong gate,
and beside it stands the prison of which, at another time, we will
speak at length. As we have said, Newgate, like Bishopsgate, was
not built upon the site of the Roman Gate but near it. This is the
traditional history of the gate:—
“This gate was first erected about the reign of Henry the First or
of King Stephen, upon this occasion. The Cathedral Church of St.
Paul, being burnt about the year 1086 in the reign of William the
Conqueror, Mauritius, then Bishop of London, repaired not the old
church, as some have supposed, but began the foundation of a new
work, such as men then judged would never have been performed:
it was to them so wonderful for heighth, length, and breadth, as also
in respect it was raised upon arches or vaults, a kind of
workmanship brought in by the Normans, and never known to the
artificers of this land before that time. After Mauritius, Richard
Beaumore did wonderfully advance the work of the said church,
purchasing the large streets and lanes round about, wherein were
wont to dwell many lay-people, which grounds he began to compass
about with a strong wall of stone and gates. By means of this
increase of the church territory, but more by enclosing of ground for
so large a cœmitery or churchyard, the high and large street
stretching from Aldgate in the east to Ludgate in the west, was in
this place so crossed and stopped up, that the carriage through the
city westward was forced to pass without the said churchyard wall
on the north side, through Paternoster row; and then south, down
Ave Marie lane; and again west, through Bowyer row to Ludgate; or
else out of Cheap, or Watheling Street to turn south through the old
Change; then west through Carter lane, again north up Creed lane
and then west to Ludgate. Which passage, by reason of so much
turning, was very cumbersome and dangerous both for horse and
man. For remedy whereof a new gate was made, and so called, by
which men and cattle, with all manner of carriages, might pass more
directly (as before) from Aldgate, through west Cheap by St. Paul’s,
on the north side: through St. Nicholas Shambles and Newgate
market to Newgate, and from thence to any part westward over
Holborn bridge, or turning without the gate into Smithfield, and
through Iseldon to any part north and by west. This gate hath of
long time been a gaol or prison for felons and trespassers, as
appeareth by records in the reign of King John and of other kings;
amongst the which I find one testifying, that in the year 1218, the
3rd of King Henry the Third, the King writeth unto the Sheriffs of
London, commanding them to repair the gaol of Newgate for the
safe keeping of his prisoners, promising that the charges laid out
should be allowed unto them upon their accompt in the Exchequer.”
Continuing our walk we overlook the Fleet River, which is much
choked with filth and rubbish, especially from things thrown into it
from the Fleet prison, whose walls it washes and whose refuse it
receives. Perhaps after heavy rains it becomes a cleaner stream.
Over against it rises the steep slope of Holborn crowned with its
ancient church of St. Andrew. The broad road on which it stands is
the military road, which branched off from the Roman road, when
London Bridge was built. Formerly, and long after the building of the
Bridge, the highway between the north and the south ran across the
marshes round Westminster, and over Thorney Island itself.
Ludgate—perhaps, we do not know—was built as a postern before
the Conquest. It was rebuilt or strongly repaired, in the year 1215,
by the Barons when they entered the City and pillaged the Jews, as
already mentioned. Ludgate is now—in this fourteenth century—also
a prison concerning which more will be said hereafter.
The wall of London at first passed in a direction due south to the
river from this gate, which was on the hill just without the Church of
St. Martin. Between the wall and the Fleet was a small piece of wet
and undesirable ground on which the Dominicans were permitted to
settle; it was their precinct, outside the jurisdiction of the City.
Presently the Friars were allowed to pull down the City walls beside
them. This was in 1276. The King ordered the City to apply some of
the murage dues to building a new wall on the banks of the Fleet, so
as to include the House of the Dominicans. Three years later the
order was renewed, yet the wall remained unfinished. The lack of
zeal probably meant a growing disbelief in the importance of the
wall, especially that part of it which overlooked the muddy banks
and the mouth of the Fleet. The wall, however, was finished in due
course.
We have now completed our circuit of the City wall and have seen
what was in the immediate neighbourhood of London. Farmhouses
and pasture lands in the direction of Stepney and Mile End; beyond
them, which we could not see, the low-lying lands and marshes of
the river Lea. North of Bishopsgate is a line of houses, three or four
stately monasteries, and inns for travellers; north of Moorgate a vast
marsh crossed by causeways, given over chiefly to kennels; beyond
the moor, the pleasant village of Iselden. At Cripplegate, a suburb
populous but composed entirely of craftsmen; outside Aldersgate,
stately monasteries, a noble hospital for the sick, a tract of ground,
flat, dotted with ponds, with some small clusters of trees upon it,
decorated by a gibbet on which hang always the mouldering remains
of some poor dead wretches, a gallows-tree on which half a dozen
can be comfortably hanged at once. This place is also the site of a
great cloth fair held once a year, of a horse fair once a week; and a
part is given over to the Jews for their burial-place. On the west,
looking out from Ludgate, there is the slope to the Fleet River, with
its bridge; the street beyond with its one or two great houses and its
shops and taverns beginning to spring up; beyond this street there is
the rising slope of the Strand, with its glittering streamlets. And
standing on the southern tower of the wall we can look across the
river, and see on the other side, the immense marsh that extends
from Redriff to Battersea, and the gentle rise of the Surrey Hills
beyond. Along that southern marsh there are few houses as yet.
Southwark is little more than a High Street. There are one or two
houses belonging to Bishop, Abbot, and noble; there are the
infamous houses on Bankside; there is the Archbishop’s Palace at
Lambeth, but on this side there is little more.
Let us now leave the wall and begin to walk about the streets of
the City—we are still, it must be remembered, in the fourteenth
century. The first and most distinctive feature of every mediæval
city, as compared with its modern successor, is the number of its
churches and of its monastic foundations. The latter, it is true, are
situated outside the very heart of the City—thus, there are no
convents in Thames Street. The Dominicans, as we have seen, were
at first outside the wall: one religious foundation there was in
Cheapside itself, but that was due to the birthplace of a saint; all the
rest were placed near the wall, either within or without, one reason
being that they were founded late when the inner part of the City
was already filled up, and another, that they were founded, for the
most part, with slender endowments, so that they were compelled to
get land where it was cheapest. But the churches stand in every
street; one cannot escape the presence of a church; and the minute
size of the parishes proves, among other things, the former density
of the population. Take, for instance, that part of Thames Street
which extends from St. Peter’s Hill to Little College Street. That is a
length of 1600 feet by a breadth averaging 400 feet. This area,
which is divided along the upper part by Thames Street, consists
almost entirely of warehouses, wharves, and narrow lanes leading to
the river stairs; the south of it consists of that curious little collection
of inhabited streets, the whole of which was reclaimed from the
foreshore; there are a tangle of narrow lanes and noisome courts
lying among and between the wharves, which lanes and courts are
always foul and stinking, inhabited by the people belonging to the
service of the Port. There are actually five parishes in that little
district. The first of them, St. Peter’s, contains not quite two acres;
the second, St. Mary Somerset, about four acres; the third, St.
Michael’s, Queenhithe, about two acres and a half; the fourth, St.
James, Garlickhithe, the same; and the fifth, St. Martin Vintry, about
three acres and three-quarters. Five parishes in this little slip of land!
But if we take the whole slip of land, which we call the riverside—an
area of a mile in length by about 400 feet in width, we find that
there are no fewer than eighteen parishes in it. All the churches now
within the City, together with those which must have been burned or
destroyed, are standing in the century we are considering. So
frequent are the churches, so scanty the dimensions of the parish,
that the most remarkable feature in the architecture and appearance
of the City is the church which one sees in every street and from
every point of view. These churches have been already rebuilt over
and over again. At first they were small wooden structures, like that
at Greenstead, Chipping Ongar, with their walls composed of trunks
cut in half and placed side by side. A few were of stone, for the
name of St. Mary Staining commemorates such a church. After the
Conquest a rage for building set in, builders and masons came over
from the Continent in numbers, and the period of Norman
architecture began. Still, however, the parish churches continued to
be small and dark. But the City grew richer: the nobles who lived in
the City and the merchants began to rebuild, to decorate, and to
beautify their churches: they pulled down the old churches, they
built them up again larger and lighter, in Early English first and next
in Decorated Style. Small the City churches continued and remained,
but to some of them were added gateways and arches. Adorned as
they were by the pious care of the citizens, for generation after
generation, by this fifteenth century they had become beautiful. The
citizens had filled the windows with painted glass, they had covered
the bare walls with paintings, they had erected tombs for themselves
with fine carved work and figures in marble and alabaster, they had
covered the carved font with a carved tabernacle, they had glorified
the roof with gold and azure, they had given the chancel carved
seats, they had adorned the altars, they had given organs, they had
endowed the church with singing men and boys, and they had
bestowed upon it such collections of plate, furniture, rich robes,
candlesticks, and altar cloths, as makes one wonder where the
Church found room to stow everything. Everybody knows the
Treasury of Notre Dame, of St. Denys, of Aix-la-Chapelle. The
cupboards are crammed with ecclesiastical gear and relics and
reliquaries. We must realise that the same thing, on a smaller scale,
is to be seen, in the fourteenth century, in every parish church of
London. We look into church after church. There are treasures in
every one, treasures that the priests and the sacristans bring out
with pride. And the monuments over the graves of City worthies
bring out very strongly, as we stand in the churches and read the
names, the fact that the members of the great distributing
Companies, largely, if not entirely, belong to families of gentle birth:
upon this fact there will be more to say in another place. Another
point is that there are few monuments older than this—the
fourteenth-century. Thus, taking half a dozen of the churches as we
walk about the streets, we find that a monument of the thirteenth
century occurs in one or two cases only. What does this mean? That
the monuments of all the merchants who died in London and are
buried in the City churches have been removed or wantonly
destroyed? I think not. It has another meaning. The erection of
monuments to the dead belongs to a very primitive stage of
civilisation, and it is also found in an advanced stage; in times of
continual uncertainty and warfare it does not always exist: nor does
the craftsman or the rustic desire a post-mortem memory. The
citizens of London before this time have not generally nourished the
desire of posthumous honour. They left money for masses, or to
beautify the church; or they founded doles for the Mind Day, but not
for the erection of a monument. This desire seems to belong to a
time when the conditions of life have been smoothed and some of
the old miseries have abated. Not that the dangers of fire, famine, or
pestilence ever weigh heavily upon the minds of a people actively
engaged; or that they are bowed down by the consciousness that
war, with a painful death on the field, is always a possibility for
them; or that they find life intolerable by reason of its diseases, its
chances, its changes, or its brevity. But it is quite certain that they
do realise so vividly the world to come, that in all their transactions it
is acknowledged in words, if not really felt, to be of far greater
importance than the world in which they live. Since, after a time of
Purgatory, one is going for ever to sit among the Saints, what
matters it whether one’s name is preserved or not? When many of
the old dangers are abated; when fortune is more stable; when
wealth accumulates; when the growth of the City brings dignity,
honour, and authority to the citizens,—then it may become natural
for the people to erect monuments in memory of the men whose
personality in life has been large and full of dignity; and then every
man will begin to desire such a monument in memory of those
surprising achievements of which he alone is conscious. Every family
will begin to desire such a commemoration, if only to swell the
family pride, and to make the church itself proclaim the glory of the
line. But in the thirteenth century these aspirations were rare. Henry
of London Stone, first Mayor and Mayor for five-and-twenty years,
was one of those thus honoured.
Let us exchange generalities for a single example.
We are standing at the entrance of a narrow lane leading north
from Thames Street. It is the street called Fish Street Hill or Labour
in Vain Hill. On the south-east corner stands the very ancient church
of St. Mary Somerset. It is placed a little back from Thames Street
with part of its churchyard on the south side: it is a large and
handsome church; the churchyard is planted with trees and the
graves are mounds of grass. We enter the street, which presents a
steep incline: down the middle runs a tiny stream, for there has
been rain; offal, bones, grease, fish-heads, dirty water, refuse of all
kinds float down this stream, which, after a heavy shower, keeps the
street comparatively clean and wholesome. There are, however,
fortunately, other scavengers besides the rain; they swoop down out
of the sky, they alight in the street, they tear the offal with their
beaks and claws, they carry it up to the house-tops; these are the
kites and crows, who build their nests on the church towers and
roofs, and find their food in the refuse thrown out into the streets.
Were it not for these birds, London streets would be intolerable.
It is a morning in May: along the street on either side are houses;
here is a rich merchant’s house standing behind its wall, and beside
it is a little tenement occupied by a craftsman. Looking up the street
one can see green trees here and there, from those of St. Mary
Somerset on the south to those of St. Nicholas Cole Abbey on the
north. Half-way up we come upon a low wall; looking over it we see
a churchyard shaded by trees and covered with graves, the grass
growing long and rank; on the west side of the churchyard stands
the church—it is a very small church called St. Mary Mounthaw, one
of the latest of the City churches, and built originally as a chapel for
a private family. Its name shows that the parish was a slice of St.
Mary Somerset, just as St. Katherine Coleman was carved out of St.
Katherine Cree, and All Hallows the Less out of All Hallows the
Great. The door is open—if we look in we see a few women
kneeling; there is the murmur of a chantry priest, for it is morning,
singing his daily mass; the church is Early English, the roof is high,
with beams crossing and recrossing, they are painted red and gold;
springing out from the side of the church are angels with outspread
wings; high up in the roof itself above the beams is a sky all blue
with silver stars. The walls of the church are decorated with bright-
coloured paintings from the life of the Blessed Virgin and her Son;
the windows are richly painted; the altar is covered with
candlesticks, crosses and furniture in white silk, gold, silver, and
latoun. There are two noble monuments, each with its effigy and its
chapel of white marble: one effigy wears a Bishop’s mitre; another is
the image of an Alderman, who was a benefactor to the church.
Dozens of candles stuck on iron sticks are burning, with a few great
wax tapers paid for by a bequest; at the door sit two old women,
beggars. On the north side of the church, and outside it, is a
projecting structure half underground. This is the anchorite’s cell
(see vol. ii. pt. ii. ch. v.): on the level of the ground is a small
aperture protected by a rusty iron grating without glass and without
shutter; by this window everything must be handed in to the
occupant. If we look through the bars, we see that within there
reigns a dim and terrible twilight, for no gleam of sunshine can
penetrate this cold and gloomy den, and even on this bright and
sunny morning the air is cold and damp like the air of a crypt. On
the other side is a narrow slit in the wall, like the leper’s squint,
through which the anchorite can witness the Elevation of the Host;
at the end of the cell a raised stone serves for an altar, a crucifix
stands upon it, and before it the anchorite spends most of his time
day and night, praying. The present occupant has been built up into
this cell for many years; he subsists on what is brought him. There is
never any fear of his being starved or forgotten: he is well provided
for, and the people offer him dainties which he will not touch, for he
lives on bread and water: sick or well, he will never leave this cell till
they find him lying dead on the floor and carry him out. And when
the cell is empty there will be no difficulty in finding a successor to
occupy his place and fulfil the same dreary austere life.
Let us leave the church and pass on. The street is very narrow,
but not so narrow as some. The houses, which are for the most part
two and three stories high, are gabled, and the windows are glazed:
many of them, such as those on Labour in Vain Hill, do not contain
shops but are what we should call private houses, some are let for
lodgings to those who come to town on business; and when the
lodger is an armiger or a noble, he hangs his scutcheon out of the
window, or fixes it on the wall above the door. Thus, Chaucer’s
attention, you will remember—see that famous lawsuit tried but the
other day, Scrope v. Grosvenor—was first called to the doubtful
heraldry on the Grosvenor shield by seeing the scutcheon hanging
out of the window in Friday Street. The houses are not in line, but
are placed as the builders choose, fronting in various directions and
abutting at different depths on the street. Here is a narrow court
leading out of the street, it is so narrow that a man standing in the
middle can easily touch each side. It contains about a dozen small
tenements inhabited by craftsmen, who are all at work in the
ground-floor rooms, which are at once workshop, kitchen, and
sleeping-room. All about, in the air, one hears the continual noise of
work, the sound of hammering, sawing, grating, the ringing of the
anvil, the voices of women who quarrel and scold. Now and then
rises, all in a moment, without warning, a sudden brawl between
two of the working men, at once knives are drawn and in a moment
the thing is over, but it leaves a little pool of blood in the middle of
the street, and a woman binds up a bleeding arm. We have seen
enough of the court. Come back into the street. Here is a gateway
and over it a gatehouse, but without battlements or portcullis. Two
or three men-at-arms are hanging about the gate, and within is a
broad square court in which boys, pages practising tilting, are riding
about. There are buildings on all four sides; one of these is a stately
hall with a lofty roof and lantern, and the others are noble buildings.
This is the town house of a great Baron, who rides with a following
of three hundred gentlemen and men-at-arms, and owns manors
broad, rich, and numerous. He maintains five hundred people, at
least, in his service. Next, there is another gateway and another
court with another hall, but not so great. This is the town house of
the Bishop of Hereford. There is no tilting or riding in his court: it is,
on the other hand, turned into a garden with roses and lilies
blossoming in the flower-beds, a fountain sparkling in the sunshine
and splashing musically. There is a south aspect, and vines are
trained upon the wall; there is a sun-dial, and some seats are placed
upon the grass. As for the house, the windows and porches are full
of beautiful carved woodwork and shields are carved on the walls.
Below the windows are figures in bas-relief representing all the
virtues, and the great window of the hall is of painted glass with the
family arms of the Bishop, a man of no mean descent, in the centre.
Near the Bishop’s house, and like unto it in appearance, but of lesser
splendour, is the house of a great merchant, as great men went in
the fourteenth century. We will presently enter one of these houses
and see how they are furnished. And among the great houses
standing side by side, rich and poor together, as it should be, are
tenements of the craftsmen, such as we have seen in the narrow
court which we have just now passed. In the street itself, dabbling in
the water barefooted, are the children, rosy-cheeked, fair-haired,
playing, running, and shouting, as they do to this day, and always
have done since the beginning of the City.
Shall we next enter the City at Ludgate and walk about its streets
from there? Ludgate is half-way up the hill that rises above the
valley of the Fleet; passing through it we stand before the west front
of St. Paul’s. The noble church must be reserved for another
occasion. We walk through the churchyard, and so by the north-east
gate of the Precinct find ourselves in Chepe.
This is the greatest market of the City. Hither come the craftsmen,
for to each craft is assigned its own place in the market. Not only do
the trades work together, but they sell their wares together, so that
there is no underselling, and everything is offered at a fixed price.
There is a great deal to be said for this custom. It is convenient
for the apprentice to live and work in the atmosphere, so to speak,
of his own trade, and to see all day long his own industry. It is also
convenient for men of the same craft to work together, first, because
solitary labour is bad for a man, next, because hours of labour can
only be enforced when men work in companies, third, because bad
work cannot be successfully palmed off as good where all work is in
common, and, last, if any other reason were wanted, because in
some trades tools are costly, and by this method can be held and
used in common. Out of this working in common spring the
fraternities and guilds and, in fulness of time, the companies. There
also grows up, what would never have arisen out of solitary labour,
the pride and dignity of trade. The dignity of trade will be greatly
increased when the City Companies become rich and strong, and
when each fraternity can carry on occasions of state its own banners
and insignia, and can wear its own distinctive dress.
There were changes in the quarters of trade from time to time
owing to causes which we can only guess.
“Men of trades and sellers of wares in this City have oftentimes
since changed their places, as they have found their best advantage.
For whereas mercers and haberdashers used wholly then to keep
their shops in West Cheap; of later time they held them on London
Bridge, where partly they do yet remain. The Goldsmiths of
Gutheron’s Lane and the Old Exchange are now, for the most part,
removed into the south side of West Cheap. The pepperers and
grocers of Soper’s Lane are now in Bucklersbury, and other places
dispersed. The drapers of Lombard Street and of Cornhill are seated
in Candlewick Street and Watheling Street. The skinners from St.
Marie Pellipers, or at the Axe, into Budge Row and Walbrook. The
stockfish-mongers in Thames Street. Wet-fish-mongers in
Knightriders Street and Bridge Street. The ironmongers of
Ironmongers’ Lane and Old Jury into Thames Street. The vintners
from the Vinetree into divers places. But the brewers for the most
part remain near to the friendly water of Thames. The butchers in
East Cheap, St. Nicholas Shambles, and the Stockes market. The
hosiers, of old time, in Hosier Lane, near unto Smithfield, are since
removed into Cordwainer Street, the upper part thereof, by Bow
Church, and last of all into Birchovers Lane by Cornhill. The
shoemakers and curriers of Cordwainer Street removed, the one to
St. Martin’s le Grand, the other to London wall near to Moorgate.
The founders remain by themselves in Lothbury. The cooks or
pastelars, for the more part, in Thames Street; the other dispersed
into divers parts. The poulters of late removed out of the Poultry,
betwixt the Stockes and the Great Conduit in Cheap, into Grass
Street and St. Nicholas Shambles. Bowyers from Bowyers’ Row by
Ludgate into divers parts; and almost worn out with the fletchers.
The paternoster bead-makers and text-writers are gone out of
Paternoster Row, and are called stationers of Paul’s Churchyard. The
patten-makers, of St. Margaret Pattens Lane, are clean worn out.
Labourers every work-day are to be found in Cheap, about Soper’s
Lane end. Horse-coursers and sellers of oxen, sheep, swine, and
such like, remain in their old market of Smithfield.”
THE OLD FOUNTAIN IN THE MINORIES, BUILT ABOUT 1480,
DEMOLISHED 1793
From an old print.
The heavy barges, laden to the water’s edge, have come down
from Oxfordshire and Wiltshire; observe the swans, the fishing-
boats, and the swarm of watermen plying between stairs, for this is
the highway of the City. Not Cheapside, or East Cheap, or Thames
Street, or the Strand is the highway of the City, but the river. And as
on a main road we pass the noble Lord and his retinue, on their war-
horses, caparisoned and equipped with shining steel and gilded
leather, and after him a band of minstrels or a company of soldiers;
or a lady riding on her palfrey followed by her servants and her
followers; so on the river we pass the stately barge of some great
courtier, the gilded barge of the Mayor, the common wherry, the tilt-
boat, the loaded lighter, and the poor old fishing-boat decayed and
crazy.
Look at the riverside houses. Yonder great palace, with its
watergate and stairs and its embattled walls, is Fishmongers’ Hall. It
is a wealthy company, albeit never one beloved of the people, whom
they must supply with food for a good fourth part of the year. That
other great house is Cold Harbour, of the first building of which no
man knows. Many great people have lived in Cold Harbour, which, as
you see, is a vast great place of many storeys, and with a multitude
of rooms. Within there is a court, invisible from the river, though its
stairs may be seen.
Almost next to Cold Harbour is the “Domus Teutonicorum,” the
Hall of the Hanseatic Merchants. What you see from the river is the
embattled wall on the river side, one side of the Hall, some windows
of the dormitories, stone houses built on wooden columns, also the
great weighing-beam and the courtyard. The front of this fortress—
for it is nothing less—contains three gates, viz. two small gates
easily closed, and one great gate, seldom opened. You see that they
have their own watergate and stairs. In everything they must be
independent of the London folk, with whom they never mix if they
can keep separate. The men live here under strict rule and
discipline; they may not marry; they stay but a short time as a rule;
and when they are recalled by the rulers of the great company they
are allowed to marry. Here, from the south side of the river, we get
the only good view of the church of St. Paul. ’Tis a noble Church: is
there a nobler anywhere? If we consider how it stands upon a hill
dominating the City and all around it, of what length it is, of what
height, how its spire seeks the sky and draws the clouds, then when
one realises these things one’s heart glows with pride at the
possession of so great and splendid a church. See how it rises far
above the houses on its south side! Was it by accident, think you,
that the churches between the bank and the Cathedral, St. Mary
Magdalene, St. Nicolas Cole Abbey, St. Benedict, and the others,
were all provided with short square towers without steeples so as to
set off the wondrous height of the Cathedral? Was it by accident that
on the west side of the Cathedral rose the spire of Blackfriars, and
on the east the lesser spire of St. Augustine’s, making a contrast
with the lofty proportions of the great church? In front of us is the
ancient port once called Edred’s Hythe after the name of a former
Wharfinger or Harbour Master or Port Captain; it was afterwards
called Potter’s Hythe and later Queen Hythe, because King John
gave it to his mother Queen Eleanor, which name it still retains. The
port is square, and open on one side to the river; there are never
any storms to wreck the shipping within. It is now filled with ships,
chiefly of the smaller kind, because the larger craft cannot pass
through the Bridge. For this reason Billingsgate long surpassed
Queenhithe in the number and importance of its ships and the
magnitude of its trade. However, at Queenhithe they are busy. The
cranes wheeze and grunt as they turn round; carriers with bales and
sacks upon their backs toil unceasingly. All round the quay runs a
kind of open cloister with an upper storey on pillars: this is the
warehouse of the Harbour.
“And as soon as the said Robert shall see the Mayor, and the
Sheriffs, and the Aldermen, coming on foot out of the said
church armed, with such banner, the said Robert (or his heirs
who owe this service unto the said city) shall then dismount
from his horse, and shall salute the Mayor as his companion and
his peer, and shall say unto him: ‘Sir Mayor, I am come to do my
service that I owe unto the city’; and the Mayor, and the
Sheriffs, and the Aldermen shall say: ‘We deliver unto you here,
as to our Banneret in fee of this city, this banner of the city, to
bear, carry, and govern, to the honour and to the profit of our
city, to the best of your power.’ And the said Robert, or his heirs,
shall receive the banner in his hand, and shall go on foot as far
as the outside of the gate, with the banner in his hand; and the
Mayor of the said city, and the Sheriffs, shall follow him to the
gate, and shall bring a horse unto the said Robert, of the price
of twenty pounds; and the horse shall be saddled with a saddle
with the arms of the said Robert thereon, and covered with
cendal with the same arms thereon. And they shall take twenty
pounds sterling, and shall deliver them unto the chamberlain of
the said Robert, for his expenses of that day. And the said
Robert shall mount the horse which the said Mayor has
presented unto him, with the banner wholly in his hand.
And as soon as he shall be mounted he shall tell the Mayor to
cause a Marshal to be chosen forthwith, of the host of the city
of London. As soon as the Marshal is chosen, the said Robert
shall cause the Mayor and his burgesses of the city to be
commanded to have the communal bell of the said city rung;
and all the community shall go to follow the banner of Saint
Paul and the banner of the said Robert; the which banner of
Saint Paul the self-same Robert shall carry in his own hand as
far as Alegate. And when they are come to Alegate, the said
Robert and the Mayor shall deliver the said banner of Saint Paul,
to be borne onward from Alegate, unto such person as the said
Robert and the Mayor shall agree upon, if so be that they have
to make their exit out of the city. And then ought the Mayor to
dismount. and the said Robert, and of each Ward two of the
wisest men behind them, to provide how the city may best be
guarded. And counsel to this effect shall be taken in the Priory
of the Trinity, by the side of Alegate.
And before every city or castle that the said host of London
besieges, if it remains one whole year about the siege, the said
Robert ought to have for each siege, from the commonalty of
London, one hundred shillings for his trouble, and no more.
And further, the said Robert and his heirs possess a great
honour, which he holds as a great franchise in the said city,
[and] which the Mayor of the city and the citizens of the same
place are bound to do unto him as of right; that is to say, that
when the Mayor wishes to hold his Great Council, he ought to
invite the said Robert, or his heirs, to be present at his council
and at the council of the city; and the said Robert ought to be
sworn of the council of the city against all persons, save the
King of England or his heirs. And when the said Robert comes to
the Hustings in the Guildhall of the city, then ought the Mayor,
or the person holding his place, to rise before him, and to place
him near unto him; and so long as he is in the said Guildhall, all
the judgments ought to be given by his mouth, according to the
record of the Recorders of the Guildhall; and as to all the waifs
that come so long as he is there, he ought to give them unto
the bailiffs of the city, or unto such person as he shall please, by
counsel of the Mayor of the said city.” (Riley, Liber
Custumarum.)
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.
ebooknice.com