Welcome Guest, Not a member yet? Register   Sign In
How to use SPARK, MarkDown-Extra?
#1

[eluser]whygod[/eluser]
Hi guys,

I have installed Spark, MarkDown-Extra and loaded it like this below,
Code:
function __construct ()
    {
        parent::__construct();
        $this->load->spark('markdown-extra/0.0.0');
    }

And with in the same class I have a method like this to call MarkDown-Extra
Code:
function change_banner()
{
  $this->data['body_title'] = 'Change Banner';
  $body_html = parse_markdown_extra($this->load->view('admin2/change_banner_form'));
  $this->data['body_content'] = $this->load->view($body_html, array('error' => ' '));
  $this->load->view('admin2/cpanel', $this->data);
}

Now I have an error message,
Code:
Unable to load the requested file: .php

I don't understand it, what could be the problem?
By the way am I using MarkDown-Extra properly?
Can you spot the not?

Thank you very much in advanced.



#2

[eluser]whygod[/eluser]
I have changed my method like this,
Code:
function change_banner()
{
  $this->data['body_title'] = 'Change Banner';
  $md = file_get_contents(APPPATH . 'views/admin2/change_banner_form.php');
  $this->data['body_content'] = parse_markdown_extra($md);
  $this->load->view('admin2/cpanel', $this->data);
}

It works, but the form doesn't function properly.

Any advice?




Theme © iAndrew 2016 - Forum software by © MyBB