[TYPO3-mvc] extbase: build a FE uri in BE

Pascal Geldmacher pgeldmacher at best-mediaforge.com
Wed Jan 20 18:00:04 CET 2010


Hi,

Thanks, Yes that's a crazy fault from me. But it is not the problem.
it doesn't change anything sadly.

So, i've take a look on the typo configuration variable and it needs the 
pageTypeUid. But if i set the pageTypeUid, i get an error in the 
tslib_content.php class

"
Fatal error: Call to a member function getPage_noCheck() on a non-object 
in 
/html/typo3/typo3_src-4.3.1/typo3/sysext/cms/tslib/class.tslib_content.php 
on line 5915"



Am 20.01.2010 17:07, schrieb dennis ahrens:
> Hi Pascal,
>
> try to remove the $builder variable between setArguments() and
> buildFrontendUri(). I think with this code you call buildFrontendUri()
> not for the same object you call setArguments() on before.
>
> I think this should work:
> $uri = $builder->setRequest($request)->setCreateAbsoluteUri(true)->setArguments(array('tx_mfblog_pi1'=>array('action'
> =>  'show', 'controller' =>  'Post', 'post' =>
> $post->getUid())))->buildFrontendUri();
>
> regards
> Dennis
>
> 2010/1/20 Pascal Geldmacher<pgeldmacher at best-mediaforge.com>:
>> Hey,
>>
>> I've a problem to create a FE uri in BE.
>> I need this link not for my own FE but for trackback.
>>
>> I've tried to use the Tx_Extbase_Web_Routing_UriBuilder to create the link
>> but it doesn't work. it builds the baseUri but it doesn't create the
>> arguments.
>>
>> That's the code which i've used:
>> $request = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
>> $request->setBaseUri($_SERVER['HTTP_HOST']);
>>
>> $builder=t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder');
>> $uri = $builder->setRequest($request)    ->setCreateAbsoluteUri(true)
>>
>> ->setArguments(array('tx_mfblog_pi1'=>array('action' =>  'show', 'controller'
>> =>  'Post', 'post' =>  $post->getUid())))
>> ->$builder->buildFrontendUri();
>>
>> Maybe i've forget something ?
>>
>> Thanks for help,
>>
>> Pascal
>>
>>
>>
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>



More information about the TYPO3-project-typo3v4mvc mailing list