Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37677

how show text in center moodle ?

$
0
0
by stephane ng.  

Hi again,

I try add block in moodle, my name block is "block_hello";

Now in the left column screen, i success i have a new blok "hello",

this is the class block hello

<?php
class block_hello extends block_base{
    public function init()
    {
        $this->title = get_string('hello','block_hello');
    }

    public function get_content(){
        if($this->content!=null)
        {
            return $this->content;
        }
    
    $this->content     = new stdClass;
    $this->content->text = 'le contenu de ce block hello';
    $this->content->footer = '<a href="#">clique me for show in center 'HELLO WORD':</a> ';

    //want to add content in the center moodle
    return $this->content;    

    }

    public function specific_definition($mform)
    {
        $mform->addElement('header','configheader',get_string('blocksettings','block'));
        $mform->setDefault('config_text','default value');
        $mform->setType('config_text',PARAM_MULTILANG);
        
        
    }

    
}

if I want display "Hello word" in the center moodle, how i can do  ?

is it in this class to add method form dispay hello  in this block ? or we must créate another

file php and not in blocks ?

 

thanks for guide me.

 


Viewing all articles
Browse latest Browse all 37677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>