English 中文(简体)
2. 信号发动机电离层_action_id()而不是平线
原标题:Expression Engine fetch_action_id() not parsing

因此,我试图以两种方式采取行动。

$ACT_ID = $this->EE->functions->fetch_action_id("classname", "function");
$ACT_ID = $FNS->fetch_action_id("classname", "function");

但是,这还是给我带来的结果:

{AID:classname:function} 

并且当其产出被看上去时,它就没有这样做。 我是否需要做什么?

最佳回答

对E2而言,有两种办法获得ACT ID,取决于您何时重新使用。

如果您在字体末/模板中重新使用该代码,则使用<代码>$this->EE->fetch_action_id(类别,方法......);,该模板将返回<代码>-AID:class:method},而模板中的模版则标语将取代实际的ACT ID。 由于业绩原因,只需要1个查询点。 如果找不到有效的ACT ID,则与模板一样,开发署的插图将保持不变。

如果您在后端/控制小组中重新使用该编码,则使用<代码>$this->EE->cp->fetch_action_id(类别,方法);,以回报实际的ACT ID。$this->EE->cp Object is only available in the Control Panel (for example, the mcp.your_module.php file). 如无有效ACT ID,将返回

问题回答

功能图书馆中有一种无证件的“inert_action_ids”方法,把行动推向模板。 因此,如果你只想获得行动编号,你可以做如下工作:

$ACT_ID = $this->EE->functions->insert_action_ids($this->EE->functions->fetch_action_id( classname ,  method ));

Update

我要补充的是,这种方法将在任何地方——前线和CP。 但是,正如一些人提到的那样,在模板中,最好使用“inert_action_ids”方法,并且用正确的行动识别器取代这些方法。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签