TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Hello Everybody
  • Hi there ! I am Tanvir. As you can see in my photo I am also a photographer. Development is my work of dream and photography is my hobby. Well I do both with passion. I am new in Kohana, Before Kohana and still now I use CI. I am still learning Kohana I found kohana much more challenging because I found many errors in the book Kohana 3 which I am using to study. So the chance of contribution is great...

    Thanks Happy Coding...

  • As a prior CI user I bet you will leave CI and pass into Kohana.

    You should check this example:

    Codeigniter:

    $CI =& get_instance(); $CI->config->load('api'); $CI->load->helper('curl'); $result = connect($CI->config->item('search_url'), 'POST', $query);

    Kohana: Instead you would do something like this:

    $config = Kohana::config_load('api'); $result = curl::connect($config['search_url'], 'POST', $query);

    Whole post is here: http://onwired.com/blog/exploring-kohana-as-an-alternative-to-codeigniter/

  • Pretty sure that code is incorrect @sineld. The configuration API was changed to using a $config variable one or two versions ago.

  • sorry, that was a quick copy/paste so I have made it wrong. loading api config file must be like: Kohana::$config->load('api');

  • Thanks for the inspiration. I use CI and moving on to Kohana. But while using the books whenever I use $this->request->response = $view; it returns a blank page. However I think I like Kohana...

  • Books? Sounds like it's out of date...

    Correct version is...

    $this->response->body(View::factory('your view'));
    

    Not sure how you got it wrong when the default code that comes with the kohana distribution should make it pretty obvious how it's done. Where did you download it from and what version is it?

  • @tanvir The book refers to Kohana 3.0 and unfortunately for the book a lot has changed between 3.0 and 3.2.

    I think there's an updated version of the book for 3.2 but I couldn't find the link...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion