This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Actions extends Tendoo_Module { | |
public function load_frontend() | |
{ | |
include_once( dirname( __FILE__ ) . '/../file/to/your/controller.php' ); | |
$controller = new YourController; | |
if ( $this->uri->segment(1) === '' && $this->uri->segment(2) === null ) { | |
return $controller->index(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$orderBuilder = new OrderReceiptBuilder( 30 ); // where 30 is the order id | |
$order = $orderBuilder->get(); | |
// Looping Over Products | |
$order->products->each( function( $product ) { | |
$product->price; | |
$product->gross_price; | |
$product->tax; | |
$product->total_tax; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function queuePromises({ promises, param, index = 0, total = 0, results = [] }) { | |
// promisesArray, _item | |
if( total === 0 ) { | |
total = promises.length; | |
} | |
console.log( `index is ${index}` ); | |
return new Promise( ( resolve, reject ) => { | |
if( promises[ index ] !== undefined ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyModule extends Tendoo_Module // should alway extends Tendoo module | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); | |
$this->events->add_filter( 'admin_menus', [ $this, 'menus' ]); | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
$this->Gui->col_width(1, 4); | |
$this->Gui->add_meta( array( | |
'col_id' => 1, | |
'namespace' => 'helloworld', | |
'type' => 'unwrapped' | |
) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HelloWorldController extends Tendoo_Module | |
{ | |
public function __construt() | |
{ | |
parent::__construct(); | |
} | |
/** | |
* Index Method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HelloWorldController extends Tendoo_Module | |
{ | |
public function __construt() | |
{ | |
parent::__construct(); | |
} | |
/** | |
* Index Method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $Routes; | |
$Routes->get( '/hellow/world', 'HelloWorldController@index' ); |
NewerOlder