Differences

This shows you the differences between two versions of the page.

Link to this comparison view

splint_object [2019/05/31 17:26] (current)
Line 1: Line 1:
 +====== Splint Object ======
  
 +The Splint object is a representation of a splint package which presents you with ''​methods''​ to directly load specific package resources. ​ This could be conveniently used when loading multiple view files from a splint package.\\
 +
 +There are two ways to get a hold of a Splint object. The first is by supplying only the first argument (vendor and package name combination) to the splint loader function. this will cause it to return a splint object.
 +
 +<code php>
 +$package = $this->​load->​splint("​vendor/​package_name"​);​
 +// Load Views
 +$package->​load->​view("​header"​);​
 +//Load Libraries
 +$package->​load->​library("​ViewPager",​ $params, $alias);
 +//Load Helpers
 +$package->​load->​helper("​cloud"​);​
 +//Load Config
 +$package->​load->​config("​a_config_file"​);​
 +</​code>​
 +
 +The second method is by using the ''​bind()''​ function.
 +
 +<code php>
 +$this->​load->​bind("​vendor/​package_name",​ $package);
 +//OR
 +$package = $this->​load->​bind("​vendor/​package_name"​);​
 +
 +// Load Views
 +$package->​load->​view("​header"​);​
 +//Load Libraries
 +$package->​load->​library("​ViewPager",​ $params, $alias);
 +//Load Helpers
 +$package->​load->​helper("​cloud"​);​
 +//Load Config
 +$package->​load->​config("​a_config_file"​);​
 +</​code>​
 +
 +===== NEXT =====
 +
 +[[auto_load_splint|Auto-Loading Splints]] => \\
 +
 +===== PREVIOUS =====
 +
 +<= [[load_splint_app|Load a Splint Application]]\\
 +
 +===== Other Topics =====
 +
 +[[load_splint|Load Splint Libraries/​Resources]]\\
 +[[auto_load_splint|Auto-Load Splint Libraries/​Resources]]\\