Or chain the methods, which is even less code:
<?= $this->headLink()
->appendStylesheet('/css/common.css');
->appendStylesheet('/css/header.css');
->appendStylesheet('/css/footer.css');
->appendStylesheet('/css/content.css');
->appendStylesheet('/css/data.css');
->appendStylesheet('/css/navigation.css');
->appendStylesheet('/css/manage.css') ?>
<?= $this->headScript() ?>
Regards, Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com
On Monday 01 Nov 2010 21:23:13 Christian Riesen wrote:
> Hi
>
> Because you echo on an append.
>
> Change this:
> > <?php echo $this->headLink()->appendStylesheet('/css/common.css') .
> > "\n"?> <?php echo $this->headLink()->appendStylesheet('/css/header.css')
> > . "\n"?> <?php echo
> > $this->headLink()->appendStylesheet('/css/footer.css') . "\n"?> <?php
> > echo $this->headLink()->appendStylesheet('/css/content.css') . "\n"?>
> > <?php echo $this->headLink()->appendStylesheet('/css/data.css') . "\n"?>
> > <?php echo $this->headLink()->appendStylesheet('/css/navigation.css') .
> > "\n"?> <?php echo $this->headLink()->appendStylesheet('/css/manage.css')
> > . "\n"?> <?php echo $this->headScript() . "\n"?>
>
> to this:
>
> <?php
> $this->headLink()->appendStylesheet('/css/common.css');
> $this->headLink()->appendStylesheet('/css/header.css');
> $this->headLink()->appendStylesheet('/css/footer.css');
> $this->headLink()->appendStylesheet('/css/content.css');
> $this->headLink()->appendStylesheet('/css/data.css');
> $this->headLink()->appendStylesheet('/css/navigation.css');
> echo $this->headLink()->appendStylesheet('/css/manage.css') . "\n";
> echo $this->headScript() . "\n";
> ?>
>
> And you will see pretty much what you expected, or something very
> close to it. There is a way to do it better, but for that I suggest
> reading up again on the view helper for headLink.
>
> On Mon, Nov 1, 2010 at 9:12 PM, Steve Rayner
>
> <[email protected]> wrote:
> > My layout contains the following;
> >
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > <title>Titanium Application</title>
> > <?php echo $this->headLink()->appendStylesheet('/css/common.css') .
> > "\n"?> <?php echo $this->headLink()->appendStylesheet('/css/header.css')
> > . "\n"?> <?php echo
> > $this->headLink()->appendStylesheet('/css/footer.css') . "\n"?> <?php
> > echo $this->headLink()->appendStylesheet('/css/content.css') . "\n"?>
> > <?php echo $this->headLink()->appendStylesheet('/css/data.css') . "\n"?>
> > <?php echo $this->headLink()->appendStylesheet('/css/navigation.css') .
> > "\n"?> <?php echo $this->headLink()->appendStylesheet('/css/manage.css')
> > . "\n"?> <?php echo $this->headScript() . "\n"?>
> > </head>
> >
> > but the html generated is this;
> >
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > <title>Titanium Application</title>
> > <link href="/css/common.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/common.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/header.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/common.css" media="screen" rel="stylesheet" type="text/css"
> > /> <link href="/css/header.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/footer.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/common.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/header.css" media="screen" rel="stylesheet" type="text/css"
> > /> <link href="/css/footer.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/content.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/common.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/header.css" media="screen" rel="stylesheet" type="text/css"
> > /> <link href="/css/footer.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/content.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/data.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/common.css" media="screen" rel="stylesheet" type="text/css"
> > /> <link href="/css/header.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/footer.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/content.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/data.css" media="screen" rel="stylesheet" type="text/css" />
> > <link href="/css/navigation.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/common.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/header.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/footer.css" media="screen" rel="stylesheet" type="text/css"
> > /> <link href="/css/content.css" media="screen" rel="stylesheet"
> > type="text/css" /> <link href="/css/data.css" media="screen"
> > rel="stylesheet" type="text/css" /> <link href="/css/navigation.css"
> > media="screen" rel="stylesheet" type="text/css" /> <link
> > href="/css/manage.css" media="screen" rel="stylesheet" type="text/css"
> > />
> >
> > </head>
> >
> > Why are the style sheets repeated so many times?
> >
> > -
> > Williams Refrigeration is a trading name of AFE Group Limited.
> > Registered in England & Wales under Registered Number 3872673.
> > Registered Office Address - Bryggen Road, North Lynn, Industrial
> > Estate, Kings Lynn, Norfolk, PE30 2HZ
> >
> > Williams Refrigeration filters email attachments for spam and viruses and
> > malicious content with Sophos Puremessage. While every care has been
> > made to ensure that this message is secure and virus free, we cannot be
> > held responsible for any damage arising from computer viruses and advise
> > that you perform your own checks on this and any other inbound messages.
> >
> > This e-mail and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they are
> > addressed. If you have received this email in error or are having
> > trouble sending email to us please notify the system administrator -
> > [email protected]
> >
> > Any views or opinions expressed in this e-mail are those of the sender
> > and do not necessarily coincide with those of Williams Refrigeration or
> > the AFE Group.