PHP code example of tomk79 / px2-px2dthelper

1. Go to this page and download the library: Download tomk79/px2-px2dthelper 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/ */

    

tomk79 / px2-px2dthelper example snippets



return call_user_func( function(){

	/* 中略 */

	// funcs: Before content
	$conf->funcs->before_content = array(
		// PX=px2dthelper
		'tomk79\pickles2\px2dthelper\main::register'
	);

	/* 中略 */

	// processor
	$conf->funcs->processor->html = array(
		// broccoli-receive-message スクリプトを挿入
		// (Optional)
		'tomk79\pickles2\px2dthelper\broccoli_receive_message::apply('.json_encode( array(
			// 許可する接続元を指定
			'enabled_origin'=>array(
				'http://127.0.0.1:8080',
				'http://127.0.0.1:8081',
				'http://127.0.0.1:8082',
			)
		) ).')'
	);

	/* 中略 */

	return $conf;
} );

/* CSSファイルに下記を記述 */

// CSSのソースコードが返されます。
// このコードには、画像などのリソースもdataスキーマ化した状態で含められます。
print (new \tomk79\pickles2\px2dthelper\main($px))->document_modules()->build_css();

// JavaScriptファイルに下記を記述

// JavaScriptのソースコードが返されます。
// スクリプト内から画像などのリソースを呼び出している場合、
// このメソッドには、リンクを解決するなどの機能はありません。
// 予め、出力後のパスを起点にパスが解決できるように作成してください。
print (new \tomk79\pickles2\px2dthelper\main($px))->document_modules()->build_js();

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

// style要素、および script要素 が出力されます。
print (new \tomk79\pickles2\px2dthelper\main($px))->document_modules()->load();

\tomk79\pickles2\px2dthelper\authorizer::initialize($px, 'member');

$base64_json = base64_encode( json_encode( array(
	// config の項目で、上書きしたい情報をセットします。
	'values' => array(
		'name' => 'New Site Name',
	),

	// config の構造に合致しない設定項目は、`symbols` の中に分類されます。
	'symbols' => array(
		'theme_id' => 'new_theme_id', 
	),
) ) );
bash
$ php .px_execute.php /?PX=px2dthelper.version
bash
$ php .px_execute.php /?PX=px2dthelper.check_status
bash
$ php .px_execute.php /path/find/content.html?PX=px2dthelper.find_page_content
bash
$ php .px_execute.php "/?PX=px2dthelper.get.navigation_info&filter=false"
bash
$ php .px_execute.php "/?PX=px2dthelper.get.realpath_theme_collection_dir"
bash
$ php .px_execute.php "/?PX=px2dthelper.get.all&filter=false&path=/index.html"
bash
$ php .px_execute.php "/?PX=px2dthelper.check_editor_mode&path=/target/path.html"
bash
$ php .px_execute.php "/?PX=px2dthelper.search_sitemap&keyword=HOME&limit=10"
bash
$ php .px_execute.php "/?PX=px2dthelper.sitemap.create&filename=foobar"
bash
$ php .px_execute.php "/?PX=px2dthelper.sitemap.delete&filename=foobar"
bash
$ php .px_execute.php /?PX=px2dthelper.document_modules.build_css
bash
$ php .px_execute.php /?PX=px2dthelper.document_modules.build_js
bash
$ php .px_execute.php /?PX=px2dthelper.document_modules.load
bash
$ php .px_execute.php "/?PX=px2dthelper.convert_table_excel2html&path=/path/to/sourcedata.xlsx"
bash
$ php .px_execute.php "/path/init/content.html?PX=px2dthelper.init_content&editor_mode=html.gui"
bash
$ # forceオプションを付加した例
$ php .px_execute.php "/path/init/content.html?PX=px2dthelper.init_content&editor_mode=html.gui&force=1"
bash
$ php .px_execute.php "/path/to/target/page_path.html?PX=px2dthelper.config.update&base64_json=xxxxxxxxxxxx"
bash
$ php .px_execute.php "/path/to/target/page_path.html?PX=px2dthelper.change_content_editor_mode&editor_mode=html.gui"
bash
$ php .px_execute.php "/path/to/target/page_path.html?PX=px2dthelper.plugins.get_plugin_options&func_div=processor.html&plugin_name=namespace\\classname::funcname"
bash
$ php .px_execute.php "/path/to/target/page_path.html?PX=px2dthelper.publish_single_page"
bash
$ php .px_execute.php "/path/to/target/page_path.html?PX=px2dthelper.packages.get_package_list"