你好大家好,
我知道如何在podscms的帮助下获取记录,但是我想更新podscms获取的记录。喜欢
$somePod = pods('somepod')->update($my_array);谁有什么建议,
发布于 2013-05-28 14:04:02
这在pods()->save() - http://pods.io/docs/save/中是可用的
<?php
// Get the book item with an ID of 5
$pod = pods( 'book', 5 );
// Set the author (a user relationship field)
// to a user with an ID of 2
$pod->save( 'author', 2 );
// Set a group of fields to specific values
$data = array(
'name' => 'New book name',
'author' => 2,
'description' => 'Awesome book, read worthy!'
);
// Save the data as set above
$pod->save( $data );
// Or the shorthand
$id = pods( 'yourpod', $id )->save( $data );还可以使用add() - http://pods.io/docs/add/
https://stackoverflow.com/questions/16790863
复制相似问题