ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Making a shared block with data

September 07, 2014 10:35am

Subscribe [2]
  • #1 / Sep 07, 2014 10:35am

    wke102

    2 posts

    I’m kind of new to this framework.

    Can I know how do I make a proper shared block that contains pulled data from the database?

    For example a “Featured product block” where I can located in different pages?

    Product Controller

    public function featured_product_block(){
      $product_array = $this->product_model->get_product();
      $data["products"] = $product_array;
      $this->load->view("blocks/product_block", $data);
    }

    So do I just call this controller from another controller? Or is there another way to do it?

  • #2 / Sep 15, 2014 6:50am

    Boyink!

    5011 posts

    You’ve posted in the ExpressionEngine forum - and I think you wanted CodeIgniter….😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases