2014-01-21 105 views
0

我正在嘗試使用create bundle symfony cmf。到目前爲止,所有的工作,因爲我能夠編輯塊,但我無法保存我的內容。我得到以下錯誤:CreateBundle Symfony CMF

Error occurred while saving 
[{"message":"Not found: cms\/test","class":"RuntimeException","trace":[{"namespace":"","short_class":"","class":"","type":"","function":"","file":"\/var\/www\/JudoSharp\/vendor\/midgard\/createphp\/src\/Midgard\/CreatePHP\/Mapper\/DoctrinePhpcrOdmMapper.php","line":86,"args":[]},{"namespace":"Midgard\\CreatePHP\\Mapper","short_class":"DoctrinePhpcrOdmMapper","class":"Midgard\\CreatePHP\\Mapper\\DoctrinePhpcrOdmMapper","type":"->","function":"getBySubject","file":"\/var\/www\/JudoSharp\/vendor\/symfony-cmf\/create-bundle\/Symfony\/Cmf\/Bundle\/CreateBundle\/Controller\/RestController.php","line":89,"args":[["string","cms\/test"]]},{"namespace":"Symfony\\Cmf\\Bundle\\CreateBundle\\Controller","short_class":"RestController","class":"Symfony\\Cmf\\Bundle\\CreateBundle\\Controller\\RestController","type":"->","function":"getModelBySubject","file":"\/var\/www\/JudoSharp\/vendor\/symfony-cmf\/create-bundle\/Symfony\/Cmf\/Bundle\/CreateBundle\/Controller\/RestController.php","line":108,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","cms\/test"]]},{"namespace":"Symfony\\Cmf\\Bundle\\CreateBundle\\Controller","short_class":"RestController","class":"Symfony\\Cmf\\Bundle\\CreateBundle\\Controller\\RestController","type":"->","function":"putDocumentAction","file":null,"line":null,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","cms\/test"]]},{"namespace":"","short_class":"","class":"","type":"","function":"call_user_func_array","file":"\/var\/www\/JudoSharp\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php","line":117,"args":[["array",[["object","Symfony\\Cmf\\Bundle\\CreateBundle\\Controller\\RestController"],["string","putDocumentAction"]]],["array",[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","cms\/test"]]]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handleRaw","file":"\/var\/www\/JudoSharp\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php","line":61,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"HttpKernel","class":"Symfony\\Component\\HttpKernel\\HttpKernel","type":"->","function":"handle","file":"\/var\/www\/JudoSharp\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/DependencyInjection\/ContainerAwareHttpKernel.php","line":62,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel\\DependencyInjection","short_class":"ContainerAwareHttpKernel","class":"Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel","type":"->","function":"handle","file":"\/var\/www\/JudoSharp\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php","line":187,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"],["string","1"],["boolean",true]]},{"namespace":"Symfony\\Component\\HttpKernel","short_class":"Kernel","class":"Symfony\\Component\\HttpKernel\\Kernel","type":"->","function":"handle","file":"\/var\/www\/JudoSharp\/web\/app_dev.php","line":28,"args":[["object","Symfony\\Component\\HttpFoundation\\Request"]]}]}] 

,我使用前端代碼如下:

<div about="cms/test" typeof="schema:WebPage" xmlns:schema="http://schema.org/"> 
    <h1 property="schema:headline">Hey bra</h1> 
    <div property="schema:text"> 
     <h2>Welcome to the Symfony CMF Demo</h2> 
     <p>If you see this page, it means that the...</p> 
    </div> 
    <p>Brotha!</p> 
    <p property="schema:sdlkfj">hey</p> 
</div> 

什麼我不知道是什麼樣的「關於」屬性是。 「about = cms/test」只是我輸入的一些任意值。我想它代表了一些phpcr-odm節點,但我甚至不知道在哪裏設置該節點,甚至不知道這些文檔如何工作。我爲我的項目創建了我的phpcr-odm數據庫,並且phpcr-odm正在工作,但我不確定所有這些東西是如何工作的。我對symfony cmf非常陌生。請讓我知道如何使用創建包保存內容,因爲文檔很糟糕。我也閱讀了phpcr-odm doctrine文檔,這很有道理,但我不確定如何將其與此問題聯繫起來。

謝謝。

回答

1

你猜對了,phpcr-odm文件的ID是。每一份文件在PHPCR中都有自己的路徑來標識它。您需要指定「about」中存在的文檔的ID。最簡單的將是映射的id和做約=「{{cmfMainContent.id}}」

,但真正想要做的是閱讀有關RDF映射什麼:http://symfony.com/doc/master/cmf/bundles/create/introduction.html#metadata一旦你定義,你可以用小樹枝助手渲染這些屬性:http://symfony.com/doc/master/cmf/bundles/create/introduction.html#rendering-content

如果您還有其他問題,請打開一個GitHub的問題上https://github.com/symfony-cmf/CreateBundle/

+0

怎麼樣了屬性=:與模型「模式標題」。我有我的rfda映射聲明,但我不明白它與我的dao有什麼關係。 –

+0

這些信息表明,該部分是您的內容的標題,採用RDFa術語。 – dbu