Q: codeigniter shorten method I am using codeignitor , currently  i have a library named "Common_func" which is autloaded.
and i can call it like this everywhere
$this->Common_func->common_method();

its ok in case of working with controllers and models , but in case of views it makes the HTML ugly , 
I know about the template parsing options , but i do not want to go with that.
is there any posible way to access with a shorten structure.
like this (or similer with least words)
Common_func->common_method();

or better than this.
Thanks.

A: The best practice is not to use libraries in View files at all, libraries are meant to be used in controllers and models. Helpers are used for views, they are random functions that help you with formatting/code generation and sometimes even more. 
Nevertheless, if you really want to keep your library and it's methods you can make "abstract" helpers, that will help you with making view files clean and readable:
common_helper.php
function common_method($arg) {
    $ci =& get_instance();
    return $ci->Common_func->common_method($arg);
}

That will keep your helpers updated with the changes made in the library.

A: I found this in codeigniter forum. This link might help you
http://codeigniter.com/forums/viewthread/139788/
or you can shrink a little if your library name is pretty long this way
class SomeClass extends CI_Controller{
   function __construct(){
      parent::__construct();
      $this->lib=$this->Really_Long_Library_name;
   }
}

this way you can use $this->lib to access its methods.
