PHP code example of phpoffice / phpproject

1. Go to this page and download the library: Download phpoffice/phpproject library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpoffice / phpproject example snippets



\PhpOffice\PhpProject\Autoloader::register();


\PhpOffice\PhpProject\Autoloader::register();

$objPHPProject = new PhpProject();$objPHPProject = new PhpProject();

// Create resource
$objRes1 = $objPHPProject->createResource();
$objRes1->setTitle('UserBoy');

// Create a task
$objTask1 = $objPHPProject->createTask();
$objTask1->setName('Start of the project');
$objTask1->setStartDate('02-01-2012');
$objTask1->setEndDate('03-01-2012');
$objTask1->setProgress(0.5);
$objTask1->addResource($objRes1);

$oWriterGAN = IOFactory::createWriter($objPHPPowerPoint, 'GanttProject');
$oWriterGAN->save(__DIR__ . "/sample.gan");