[Flow] Fatal error: help please
Steffen Wickham
steffen at gaming-inc.de
Mon Mar 24 15:07:38 CET 2014
Hello Richard,
this error means that your model doesn'T have a method called
"getTitle()" or, that's what I expect here, that there is no blog
returned by your repository but you try to access it anyway.
You should add a check if it is not null ($blog !== NULL) before
accessing its methods, especially when you do templating by your own and
not using Fluid.
Greetings
Steffen
Am 24.03.14 14:56, schrieb Richard Benson:
> I have just started running through the documentation in an effort to
> try and gain a greater understanding of this platform.
>
> Fatal error: Call to a member function getTitle() on a non-object in
> C:\xampp\htdocs\tutorial\Data\Temporary\Development\Cache\Code\Flow_Object_Classes\TYPO3_Blog_Controller_PostController.php
> on line 29
>
> public function indexAction() {
> $blog = $this->blogRepository->findActive();
> $output = '
> <h1>Posts of "' . $blog->getTitle() . '"</h1>
> Line 29
> <ol>';
>
> foreach ($blog->getPosts() as $post) {
> $output .= '<li>' . $post->getTitle() . '</li>';
> }
>
> $output .= '</ol>';
>
> return $output;
> }
>
> What is this error and what do I need to do to fix it.
>
> Kind Regards
>
> Richard
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list