I'm using codeigniter.Now I am upgrading CodeIgniter from 2.2.0 to 3.0.0
I need to use PhpExcel.But it shows an error like Non-existent class: CI_Excel
Please anyone help me.
The system/ directory is reserved for CI, you're not supposed to modify or put anything in there.
Any custom libraries you use should go into application/libraries/.
change the library name As CI_Ex.... and save it on libraries folder
Related
ok this might be a very strange thing.
it's not the first time I work a symfony project but:
I used the symfony generate:bundle command and after that I created a bundle. Lets call it "CrimeBundle".
I saw it made a folder inside the src/
It also made automatically a DefaultController and an index.html.twig file.
Now whenever I use:
return $this->render('CrimeBundle:Default:index.html.twig');
it doesn't work: I get the error:
Unable to find template "CrimeBundle:Default:index.html.twig" (looked into: /Users/admin/sites/solve/app/Resources/views, /Users/admin/sites/solve/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form).
however it works whenever I use the namespaced twig path like:
return $this->render('#Crime/Default/index.html.twig');
I like the first option, because on my other projects I use it too. None of them are the same version, currently I use: 3.4.1
Again the file is there, because it works with namespaced twig paths.
I can't understand why return $this->render('CrimeBundle:Default:index.html.twig'); wouldn't work as symfony generated this code.
According to this - https://symfony.com/doc/3.4/templating.html#referencing-templates-in-a-bundle
That's the only reference type the support for bundle templates
#BundleName/directory/filename.html.twig
If you go to docs for symfony 3.1 you'll see that was the last version that supported old reference
AcmeBlogBundle:Blog:index.html.twig
Maybe you can create a pull request for this file
SensioGeneratorBundle/bundle/DefaultController.php.twig
I'm facing trouble when using PHPWord with CodeIgniter in loadTemplate always return error "Template Not Found".
I'm using phpword in third party and create Word.php class in library to call it.
My CodeIgniter not a pure one. It already injected like some homemade cms from previous programmer.
My Question is how to I know where is the path of loadTemplate?
Any info needed you can ask me I will provide for you
Thanks,
Hendra
I'm not sure if I understood your scenario, but in any case there is no magic in how the path of loadTemplate works - it works exactly the same as you would access any file with php, i.e. either you place your template file under the phpunit library and use a relative path or you place your file somewhere else and use a full path (or some alias if you have some defined in your server (apache/nginx/..) configuration).
I'm new in CI and now I'm trying to use CodeIgniter 3 to develop my site. I just only extract the framework and change only one think in config/autoload.php file:
$autoload['libraries'] = array('database','input');
when I run the site, an error occur:
Unable to load the requested class: Input
When I tried it with CI version 2.2.0 stable, every thing is OK, no errors
Could some one explain why and help me to solve it?
As of documentation input library is loaded by default.
This class (input) is initialized automatically by the system so there is no need to do it manually.
Autoloading documentation http://www.codeigniter.com/userguide3/general/autoloader.html
By default the library load from system/core folder in you CI. But the Input library is located on the core folder so you need to give relative path to the Input.php like this
$autoload['libraries'] = array('database','../core/input');
I'm trying to use this extension
But it gives me the following error when loading the library:
Unable to load the requested class: Language
Also if I write MY_Language instead, it gives me the following error:
Fatal error: Class 'CI_Language' not found in C:\wamp\www\ckphp\application\libraries\MY_Language.php on line 79
I am using WAMP and CI v. 2.2.0
Thanks!
I figured it out myself after some more researching...
Apparently the language class is not even in the library folder, but in core folder, meaning it should be placed in the core application/core folder. Also the name is not CI_Language, but CI_Lang, meaning the file name has to be MY_Lang (if MY_ is your prefix). The last thing to change in the extension is
parent::CI_Language();
to
parent::__construct();
and everything should work fine!
Usage:
$this->lang->load('set', 'language'); // To load a language
$this->lang->line('key'); // to display the text
or simply
lang('key'); // if using the language helper
Hope this will help others in the future!
I made a GIST for latest CodeIgniter 3.1.X including with migration to create the database structure
https://gist.github.com/cyberfly/885b320fdf914ae15f7316b22cc72f32
I have a fresh version of CI running and I've installed the codeigniter-oauth2 spark via bash on my Ubuntu instances on EC2.
I followed the directions of the documentation and created a controller called auth using the demo code.
I have looked in my sparks folder and all the correct files/folders are there (as well as the /0.4.0 folder).
I have added the Facebook
My autoloads file has this
$autoload['libraries'] = array('session','OAuth2');
Now when I open the page mydomain.com/auth/sessions/facebook I get the error
"Unable to load the requested class: oauth2"
I can't seem to find any other assistance online regarding this issue online. I don't think it's an issue of not having the right case as I have tried all different ways of writing it.
Any direction to fix this issues would be greatly appreciated.
Use lower case when loading libraries.
$autoload['libraries'] = array('session','oauth2');
$autoload['sparks'] = array('OAuth2/0.4.0');