-- Robert Castley <[EMAIL PROTECTED]> wrote
(on Friday, 18 April 2008, 01:09 PM +0100):
> In my layout.phtml file I have:
> 
> <?php  echo $this->doctype('XHTML1_STRICT'); ?>
> <html>
>   <head>
>     <?php echo $this->headLink()->appendStylesheet('css/' . $this->css .
> '.css'); ?>

Add a blank link between this and the next line, or make sure there is
a space after your closing ?> tag; otherwise, no newline will be
presented between this and the next line. (PHP ignores line-endings
after a closing ?> tag)

>     <?php echo $this->headMeta()->appendHttpEquiv('pragma', 'no-cache'); ?>
>   </head>
>   <body>
>  
> But the source in the browser is not nicely formatted i.e. no EOL
> 
> E.g.
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/
> xhtml1/DTD/xhtml1-strict.dtd"><html>
>   <head>
>     <link href="css/magik.release.css" media="screen" rel="stylesheet" type=
> "text/css" />    <meta http-equiv="pragma" content="no-cache" />  </head>
> 
>   <body>
> 
> I would like it to look like:
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/
> xhtml1/DTD/xhtml1-strict.dtd">
> <html>
>   <head>
>     <link href="css/magik.release.css" media="screen" rel="stylesheet" type=
> "text/css" />
>     <meta http-equiv="pragma" content="no-cache" />
>   </head>
>   <body>
> 
> No I can achieve this by adding PHP_EOL to the end of each echo statement but
> then the code starts to look messy:
> 
> E.g.
> 
> <?php  echo $this->doctype('XHTML1_STRICT') . PHP_EOL; ?>
> <html>
>   <head>
>     <?php echo $this->headLink()->appendStylesheet('css/' . $this->css .
> '.css')  . PHP_EOL;  ?>
>     <?php echo $this->headMeta()->appendHttpEquiv('pragma', 'no-cache')  .
> PHP_EOL;  ?>
>   </head>
>   <body>
> 
> But my source is looking just fine!
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/
> xhtml1/DTD/xhtml1-strict.dtd">
> <html>
>   <head>
>     <link href="css/magik.release.css" media="screen" rel="stylesheet" type=
> "text/css" />
>     <meta http-equiv="pragma" content="no-cache" />
>   </head>
>   <body>
> 
> 
> Is there another way?
> 
> Cheers,
> 
> - Robert
> 
> 
> ________________________________________________________________________
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> ________________________________________________________________________

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to