Calling ContentHelperRoute from CLI

112 views
Skip to first unread message

alikon

unread,
Apr 9, 2013, 2:45:09 AM4/9/13
to joomla-de...@googlegroups.com
In a CLI application  i run this code to get an article URL

$item->link = JRoute::_(JURI::base() . ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));

but i was'nt able to get back  the correct URL  seems not recognize the site domain URL

can someone give me some tips  for get the correct article URL even from CLI side ?

thx

alikon

unread,
Apr 20, 2013, 6:38:23 AM4/20/13
to joomla-de...@googlegroups.com
Solved in a quick and dirty way
saved site url on extension parameter...

there is a more beautifull way ?

Amy Stephen

unread,
Apr 20, 2013, 9:28:56 AM4/20/13
to joomla-de...@googlegroups.com
Unless you save it and pass it into the CLI routine, your approach of
saving it (as a parameter or some other type of permanent state
value), would be the way to go. The command line has no concept of the
HTTP request - doesn't live in that world, so to speak.
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to joomla-dev-gene...@googlegroups.com.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages