本文整理汇总了PHP中DfpUser::GetCreativeWrapperService方法的典型用法代码示例。如果您正苦于以下问题:PHP DfpUser::GetCreativeWrapperService方法的具体用法?PHP DfpUser::GetCreativeWrapperService怎么用?PHP DfpUser::GetCreativeWrapperService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DfpUser
的用法示例。
在下文中一共展示了DfpUser::GetCreativeWrapperService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
error_reporting(E_STRICT | E_ALL);
// You can set the include path to src directory or reference
// DfpUser.php directly via require_once.
// $path = '/path/to/dfp_api_php_lib/src';
$path = dirname(__FILE__) . '/../../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'Google/Api/Ads/Dfp/Lib/DfpUser.php';
require_once dirname(__FILE__) . '/../../../Common/ExampleUtils.php';
try {
// Get DfpUser from credentials in "../auth.ini"
// relative to the DfpUser.php file's directory.
$user = new DfpUser();
// Log SOAP XML request and response.
$user->LogDefaults();
// Get the CreativeWrapperService.
$creativeWrapperService = $user->GetCreativeWrapperService('v201403');
$labelId = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE';
// Create creative wrapper objects.
$creativeWrapper = new CreativeWrapper();
$creativeWrapper->labelId = $labelId;
$creativeWrapper->ordering = 'INNER';
$creativeWrapper->header = new CreativeWrapperHtmlSnippet();
$creativeWrapper->header->htmlSnippet = '<b>My creative wrapper header</b>';
$creativeWrapper->footer = new CreativeWrapperHtmlSnippet();
$creativeWrapper->footer->htmlSnippet = '<b>My creative wrapper footer</b>';
// Create the creative wrappers on the server.
$creativeWrappers = $creativeWrapperService->CreateCreativeWrappers(array($creativeWrapper));
// Display results.
if (isset($creativeWrappers)) {
foreach ($creativeWrappers as $creativeWrapper) {
printf("Creative wrapper with ID '%d' applying to label '%d' was" . " created.\n", $creativeWrapper->id, $creativeWrapper->labelId);