Skip to content

Instantly share code, notes, and snippets.

View Blair2004's full-sized avatar
🏠
Working from home

Blair Jersyer Blair2004

🏠
Working from home
View GitHub Profile
@Blair2004
Blair2004 / module-config.xml
Last active March 22, 2018 11:03
Tendoo CMS module config file
<?xml version="1.0"?>
<application>
<namespace>my_namespace</namespace>
<name>My Module</name>
<description>My module description</description>
<version>1.0</version>
<main>entry.php</main>
<language>language/</language>
<dependencies>
<module namespace="somemodule">Module Name</module>
@Blair2004
Blair2004 / entry.php
Last active August 10, 2018 00:33
My Module Entry
<?php
class MyEntryModule extends Tendoo_Module
{
/**
* Constructor is used to build the module
* And to register actions and filters
**/
public function __construct()
{
parent::__construct();
@Blair2004
Blair2004 / actions-hierarchy.xml
Created March 22, 2018 11:43
Hooks Tendoo CMS
<?xml version="1.0" encoding="utf-8"?>
<action namespace="after_app_init">
<action namespace="is_connected">
<action namespace="load_dashboard">
<action namespace="before_body_content"></action>
<action namespace="do_enable_module"></action>
<action namespace="do_disable_module"></action>
<action namespace="do_extract_module"></action>
<action namespace="do_remove_module"></action>
<action namespace="load_dashboard_home"></action>
<?php
global $Routes;
$Routes->get( '/hellow/world', 'HelloWorldController@index' );
<?php
class HelloWorldController extends Tendoo_Module
{
public function __construt()
{
parent::__construct();
}
/**
* Index Method
<?php
class HelloWorldController extends Tendoo_Module
{
public function __construt()
{
parent::__construct();
}
/**
* Index Method
<?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'
) );
@Blair2004
Blair2004 / HelloWorldNexoPOS.php
Created August 24, 2018 22:33
How to create a menu for a module
<?php
class MyModule extends Tendoo_Module // should alway extends Tendoo module
{
public function __construct()
{
parent::__construct();
$this->events->add_filter( 'admin_menus', [ $this, 'menus' ]);
}
/**
<?php
class MyModule extends Tendoo_Module // should alway extends Tendoo module
{
public function __construct()
{
parent::__construct();
$this->events->add_filter( 'admin_menus', [ $this, 'menus' ]);
}
/**
@Blair2004
Blair2004 / HelloWorldModuleMenu3.php
Created August 24, 2018 22:48
Create a menu before dashboard
<?php
class MyModule extends Tendoo_Module // should alway extends Tendoo module
{
public function __construct()
{
parent::__construct();
$this->events->add_filter( 'admin_menus', [ $this, 'menus' ]);
}
/**