简体   繁体   English

如何在Joomla 3中获取文章的“链接A”?

[英]How to Get the “Link A” of an article in Joomla 3?

I would like to know what is the code to get links "Link A" or "Link B" found in the panel to create an article, maybe you can enlighten me. 我想知道在面板中找到创建链接的链接“ Link A”或“ Link B”的代码是什么,也许可以启发我。

Image for example http://goo.gl/v9jXU2 图像,例如http://goo.gl/v9jXU2

In article model there is a function called getItem($pk) where $pk is article id. 在文章模型中,有一个名为getItem($ pk)的函数,其中$ pk是文章ID。

File: components\\com_content\\models\\article.php 文件: components\\com_content\\models\\article.php

Call this function with passing article id. 调用此函数并传递商品ID。 this will return all article related data. 这将返回所有与文章相关的数据。

In result you can find links "Link A" or "Link B" in urls variable like below: 结果,您可以在urls变量中找到链接“ Link A”或“ Link B”,如下所示:

$result = $model->getItem($articleId);

$result->urls contains information related to links "Link A" or "Link B". $result->urls包含与链接“链接A”或“链接B”有关的信息。 json_decode this data and use accordingly. json_decode此数据并相应地使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM