[TYPO3-mvc] Object has a title property but it doesn't show in the frontend

Stephen Bungert stephen at bungert.co.uk
Sun Jul 18 15:22:00 CEST 2010


For some reason the title property has been created with a capital T in 
my book model by the kickstarter:


	
	
	
	/**
	 * Setter for Title
	 *
	 * @param string $Title title descrip
	 * @return void
	 */
	public function setTitle($Title) {
		$this->Title = $Title;
	}

	/**
	 * Getter for Title
	 *
	 * @return string title descrip
	 */
	public function getTitle() {
		return $this->Title;
	}

But the field is lowercase and exists in the db as lowercase:

CREATE TABLE tx_gamebook_domain_model_book (
	uid int(11) NOT NULL auto_increment,
	pid int(11) DEFAULT '0' NOT NULL,
	
	
	title tinytext,
	...

The fluid debug also lists the property as having a lowercase t.

Any ideas about why the kickstarter did that? Was it something I did? I 
haven't altered the methods yet, that's how they were made by the KS.

On 17.07.2010 20:25, Stephen Bungert wrote:
> Here is my fluid template:
>
> <p>Gamebook List (Default Template)</p>
> <f:if condition="{books}">
> <f:then>
> <ul>
> <f:for each="{books}" as="book">
> <f:debug title="Debug of MyArray">{book}</f:debug>
> <li class="book{book.uid}">
> <h2 class="title">{book.title}</h2>
> <div class="description">{book.description}</div>
> </li>
> </f:for>
> </ul>
> </f:then>
> <f:else>
> <p>There are no gamebooks.</p>
> </f:else>
> </f:if>
>
>
> The debug of my object (there is only one at the moment shows:
>
> Tx_Gamebook_Domain_Model_Book Object
> (
> [title:protected] => Book1
> [description:protected] => Book description.
> [image:protected] =>
> [playcount:protected] =>
> [start_section:protected] =>
> [attr1:protected] =>
> [attr2:protected] =>
> [attr3:protected] =>
> [attr4:protected] =>
> [genre:protected] =>
> [series:protected] =>
> [_cleanProperties:Tx_Extbase_DomainObject_AbstractEntity:private] => Array
> (
> [title] => Book1
> [description] => Book description.
> [image] =>
> [playcount] =>
> [start_section] =>
> [attr1] =>
> [attr2] =>
> [attr3] =>
> [attr4] =>
> [genre] =>
> [series] =>
> [uid] => 1
> )
>
> [uid:protected] => 1
> [_localizedUid:protected] => 1
> [_languageUid:protected] => 0
> [_isClone:Tx_Extbase_DomainObject_AbstractDomainObject:private] =>
> )
>
> But the h2 tag in my template is empty, the description shows up however.
>
> Is there something wrong with my template that I can't see? Why would
> description output something but not title? There is a title.
>



More information about the TYPO3-project-typo3v4mvc mailing list