Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS

[eluser]ray73864[/eluser]
Hi Yorick,

I downloaded 0.9.6 and followed how you did the 2 other widgets, however my new widget doesn't seem to be appearing.

widget.json looks like this:

Code:
{
    "name"        :    "Opening Hours",
    "author"        :    "Ray Herring",
    "description"    :    "This widget displays the opening hours for the pharmacy",
    "license"        :    "MIT License"
}

opening_hours.php:

Code:
<?php
/*
* @name     Recent News Widget
* @author     Yorick Peterse
* @link    http://www.yorickpeterse.com/
* @package PyroCMS
* @license MIT License
*
* This widget displays the opening hours for the pharmacy
*/
class Opening_Hours extends Widgets {
    
    
    // Run function
    function run()
    {
        $this->CI->load->module_model('pages','pages_m');
        print_r($this->CI->pages_m->page());
    }
    
    
    // Install function (executed when the user installs the widget)
    function install()
    {
        $name = 'opening_hours';
        $body = '';
        $this->install_widget($name,$body);
    }
    
    
    // Uninstall function (executed when the user uninstalls the widget)
    function uninstall()
    {
        $name = 'opening_hours';
        $this->uninstall_widget($name);
    }
}
?>

both files live in the directory 'widgets/opening_hours'


Messages In This Thread
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS - by El Forum - 07-30-2009, 03:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB