PHP code example of se7enxweb / expsite-core

1. Go to this page and download the library: Download se7enxweb/expsite-core 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/ */

    

se7enxweb / expsite-core example snippets


$helper = new expSiteBundleMailHelper();
$helper->sendMail(
    array( '[email protected]' => 'Site Contact' ),
    'New message',
    'design:mail/contact.tpl',
    array( 'name' => 'A visitor' ),
    array( '[email protected]' => 'No reply' )
);

$helper = new expSiteBundlePathHelper();
$path = $helper->getPath( 123, array(
    'use_all_content_types' => false,
    'show_current_location' => false,
    'absolute_url' => false,
) );

foreach ( $path as $item )
{
    // $item['text']     — item label (breadcrumb_title field if present and filled, else node name)
    // $item['url']      — '/url_alias', absolute when absolute_url is true, or false when suppressed
    // $item['location'] — the eZContentObjectTreeNode
}

$helper = new expSiteBundleRedirectHelper();
$url = $helper->checkRedirect( $node );
if ( $url !== false )
{
    return eZHTTPTool::redirect( $url, array(), 301 );
}