page_attribute_display - extra span markup

Permalink 1 user found helpful
I am her : concrete\blocks\page_attribute_display\view.php
//full code 
<?php
 defined('C5_EXECUTE') or die('Access Denied.');
echo $controller->getOpenTag();
// Look at this line 
  echo "<span class=\"ccm-block-page-attribute-display-title\">".$controller-
>getTitle()."</span>"
//
 echo $controller->getContent();
 echo $controller->getCloseTag();

Why the <span></span> class is without "IF" getTitle not null than print span?
In this code when the user leave the title empty he gets empty span in the markup.
///////////////////////////////////////////
Q2. what is this markup? the dots in the start-end. where i can read more about this conseopt of markup
.$controller->getTitle().

siton
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi siton,

I agree, the title should be displayed conditionally.

Example:
<?php defined('C5_EXECUTE') or die('Access Denied.');
echo $controller->getOpenTag();
if ($controller->getTitle()) {
    echo '<span class="ccm-block-page-attribute-display-title">' . $controller->getTitle() . '</span>';
}
echo $controller->getContent();
echo $controller->getCloseTag();
siton replied on at Permalink Reply
siton
OK :) thanks.

What about Q2 - what is this markup? i saw this in a lot of blocks.
. my-code .
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
@siton

The dot is the PHP concatenation operator:
http://php.net/manual/en/language.operators.string.php...

The $controller->getTitle() portion of the code refers to the getTitle() method in the controller file:
https://github.com/concrete5/concrete5/blob/develop/web/concrete/blo...