【发布时间】:2014-01-13 08:11:41
【问题描述】:
我想删除一个频道中的所有数据。我发现,删除频道中所有条目的最佳方法是删除此频道并按照本文重新创建它: https://expressionengine.stackexchange.com/questions/7648/what-is-the-best-way-to-delete-every-entry-in-a-channel
我尝试删除频道,请关注这篇文章: http://ellislab.com/expressionengine/user-guide/development/api/api_channel_structure.html
我知道site_id是1,我需要删除的频道的channel_id是1。 但是当我尝试这些代码时:
ee()->load->library('api'); ee()->api->instantiate('channel_structure');
$channel_id = 1;$site_id = 1;
ee()->api_channel_structure->delete_channel((int) $channel_id, [(int) $site_id]);
我收到了这个错误:
解析错误:语法错误,/var/www/vhosts/au/admin/expressionengine/libraries/Functions.php(679) 中的意外 T_STRING:第 7 行的 eval() 代码
我试过了:
ee()->api_channel_structure->delete_channel((int) 1, [(int) 1]);
ee()->api_channel_structure->delete_channel(1, 1);
但是遇到了同样的问题。
有人知道如何解决这个问题。非常感谢!
【问题讨论】:
-
如果你在这里没有得到你希望的回复,我建议你在专门的 EE 网站上发帖:expressionengine.stackexchange.com