想把网站从织梦转到joomla,里面有太多的文章了,数据库不能丢。两步:读出来,写进去
写解决写进去
先去下面的地址下个基本组件,然后通过扩展管理器上传到joomla后台
http://download.csdn.net/detail/masofeng/8834417
然后再helloworld.php中写代码。调用的话就点组件->helloworld
代码如下
<?php
require_once JPATH_ADMINISTRATOR . '/components/com_categories/models/category.php';
require_once JPATH_ADMINISTRATOR . '/components/com_categories/tables/category.php';
$new_category = new CategoriesModelCategory ();
$data = array (
'id' => 0,
'hits' => '0',
'parent_id' => '79',
'extension' => 'com_content',
'title' => '风湿免疫科',
'alias' => 'fengshimianyike',
'note' => '',
'published' => '1',
'access' => '1',
'language' => '*'
);
var_dump ( $new_category->save($data) );
echo "Hello World administration" . JPATH_ADMINISTRATOR;
?>