CodeIgniter from another class |
[eluser]consigliere[/eluser]
I am writing my own class project in PHP and I would like to import form validation class from codeIgniter, is this possible?
[eluser]nelson.wells[/eluser]
Yes. In your functions in your class, you will do $ci =& get_instance(); and then you can access the super object like you would any other time (usually like 'this'). $ci->load->library("form_validation");
[eluser]consigliere[/eluser]
[quote author="nelson.wells" date="1269920188"]Yes. In your functions in your class, you will do $ci =& get_instance(); and then you can access the super object like you would any other time (usually like 'this'). $ci->load->library("form_validation");[/quote] I watched something like this in http://ellislab.com/codeigniter/user-gui...aries.html What codeIgniter libraries do I need to import on my own class? thanks
[eluser]frist44[/eluser]
depends what kind of functionality you need. If you explain more about what you're trying to do inside your class, we could probably give you more direction.
[eluser]consigliere[/eluser]
[quote author="frist44" date="1269931582"]depends what kind of functionality you need. If you explain more about what you're trying to do inside your class, we could probably give you more direction.[/quote] My case would be Calling CI libraries from outside script instead of http://codeigniter.com/wiki/Calling_CI_m...de_script/, I want to use form validation class from a AMFPHP Service. :o)
[eluser]consigliere[/eluser]
I tried and PHP throws this error: Quote:Fatal error: Call to a member function library() on a non-object in Vehicles.php on line Here are my files based on http://codeigniter.com/wiki/Calling_CI_m...de_script/ config_constants.php Code: <?php ci_model_remote_open.php Code: <?php Vehicles.php Code: <?php
|
Welcome Guest, Not a member yet? Register Sign In |