[英]How to start work MongoDB with php kohana framework
我目前正在使用MongoDB使用php Kohana框架開發應用程序。 我已經有了適合此框架的MongoDB模塊鏈接 。 按照給定的說明,我已經使用應用程序配置了模塊。 但是我堅持這里無法進行進一步的開發工作。 基於MongoDB的查詢無法與此模塊一起使用。 從集合中選擇單個文檔時,代碼出現錯誤。
<?php defined('SYSPATH') OR die('No Direct Script Access');
Class Model_Cms extends Model
{
public function __construct()
{
$this->mongo_db = MangoDB::instance('default');
}
/*Get the CMS Content*/
public function getcmscontent($content,$default_companyid="")
{
$cms_result = $this->mongo_db->findOne('cms');
return $cms_result;
}
}
誰能幫我進一步。
$cms_result = $this->mongo_db->find_one(MDB_CMS,array('type'=>1,'status'=>1,'menulinks.menu_link'=>$content),array('content','meta_keyword','meta_title','meta_description','menu'));
在這個問題上花費了幾個小時之后,我已經使用了這種方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.