Blair2004 / tendoo-cms

This version of Tendoo CMS is not supported by Nexo Solutions. If you want to use Gastro, you need to have NexoPOS
https://1.envato.market/rqYnD
Other
52 stars 46 forks source link

View Not loading #29

Closed fayri closed 7 years ago

fayri commented 7 years ago

Hi Blair, I've got the new code and it works fine this time. But now the problem is creating my first module, First i tried my code, but wasn't able to load the view. Then i tried your provided code in sample, and still its not.

image

Yes i know i've made some changes to class name, but i've changed the directory name and paths accordingly. Kindly check your self and if you need to see my code its added below:

`<?php //! defined( 'APPPATH' ) ? die() : NULL; defined('BASEPATH') or exit('No direct script access allowed');

class helloClass extends CI_model { function construct() { parent::construct(); // Events // change send administrator emails $this->events->add_action( 'after_app_init' , array( $this , 'after_session_starts' ) ); $this->events->add_filter( 'admin_menus' , array( $this , 'menu' ) ); $this->events->add_action( 'load_dashboard' , array( $this , 'dashboard' ) );

    $this->load->model( 'gui' );
}
function after_session_starts()
{
    //$this->load->model( 'hello_model' );

}
function menu( $menus )
{
    $menus[ 'hellowolrd' ]      =   array(
        array(
            'title'         =>      __( 'Hello World' ), // menu title
            'icon'          =>      'fa fa-star', // menu icon
            'href'          =>      site_url('dashboard/foo') // url to the page
        )
    );
    return $menus; // return global menu array
}
function dashboard()
{

    $this->gui->register_page( 'foo' , array( $this , 'foo' ) ); // will register a page with "foo" as slug reachable like this "http//example.com/index.php/dahsboard/foo
    $this->gui->register_page( 'bar' , array( $this , 'bar' ) ); // will register a page with "foo" as slug reachable like this "http//example.com/index.php/dahsboard/bar
    //var_dump($this->gui);
}
function foo()
{

    $this->load->view('../modules/hello/views/foo_view' );
}
function bar()
{
    $this->load->view('../modules/hello/views/bar_view' );
}

} new helloClass;`

fayri commented 7 years ago

you can see the directory structure in this screenshot:

image

fayri commented 7 years ago

Also another error was,


An uncaught Exception was encountered

Type: RuntimeException

Message: Unable to locate the model you have specified: HelloWorld_model

Filename: D:\wamp64\www\tendoocms30\application\core\Tendoo_Loader.php

Line Number: 349


after i comment the load model line, the error changed to this one:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Dashboard::$gui

Filename: core/Model.php

Line Number: 77

Blair2004 commented 7 years ago

I'm so sorry for late reply

it's now

$this->Gui, instead of $this->gui

I'm currently working on this https://codecanyon.net/item/nexopos-extendable-php-point-of-sale/16195010

I would like to share tips on how to create module for Tendoo CMS. If you need help i'll be there

Blair2004 commented 7 years ago

Also, don't use CI_Model for extending module class, but Tendoo_Module

fayri commented 7 years ago

I think you must add a hello world module just for example. Although you have added reset module there. But It'll be better if you add an example with MVC. I've seen nexopos and therefore i've decided to use tendoo cms for my new project. I'll try to understand it fully, but may bother you until it ends up with some productive webapp. Also after submitting this issue, I use $this->Gui and it was working fine. But don't know why it wasn't accepting, $this->load->model('GUI', 'gui'); as per codeigniter docs, it'll create new object named gui for model GUI, kindly check if that works? and thanks for help, I'll ask more if needed. If you can provide me skype id or email I'll send you email for further help.

fayri commented 7 years ago

Now lets talk about frontend too. I'm not sure how themes will work? As when I tried to use it somehow it shows a blank page. but i was able to use default welcome_message.php. But then how I'll be able to use the themes/hello?

Blair2004 commented 7 years ago

$this->load->model('GUI', 'gui'); it's loaded by default, you don't need to load it. here is my skype id "blair_jersyer" ;)

Blair2004 commented 7 years ago

Contact me on skype, we'll discuss more easier