I am new in cakephp. I am getting the following error in my page.
Error: Class 'cakeplugin' not found
File: C:\wamp\www\cakephp\app\Config\bootstrap.php
Line: 27
Notice: If you want to customize this error message, create app\View\Errors\fatal_error.ctp
To load all plugins that you have added, put this in your config/bootstrap.php, :
CakePlugin::loadAll();
Related
I have attempted a few times to create my own bake theme following the tutorial here:
https://book.cakephp.org/bake/1/en/development.html#creating-a-bake-theme
When I attempt to run my theme, called Dashboard, I get these:
Error: "Dashboard" is not a valid value for --theme. Please use one of "Bake, Migrations, WyriHaximus/TwigView"
Error: "DashboardTheme" is not a valid value for --theme. Please use one of "Bake, Migrations, WyriHaximus/TwigView"
I attempted the following commands:
cake bake all --theme Dashboard clients
cake bake all --theme DashboardTheme clients
My file structure:
The plugin wasn't loaded, missing statement in bootstrap().
I'm new in cakePHP and I'm trying to run Endroid/QrCode in Cakephp2.x with no success. My controller looks like follows:
public function presta_my_function(){
App::import('Vendor', 'Endroid\QrCode', array('file' => 'Endroid/QrCode/QrCode.php'));
in this case I get the following error:
2017-09-27 02:11:55 Error: Fatal Error (1): Interface 'Endroid\QrCode\QrCodeInterface' not found in [C:\MAMP\htdocs\xxxx\app\Vendor\Endroid\QrCode\QrCode.php, line 18].
On the other hand, if try to do an import of QrCodeInterface.php before loading QrCode.php I get the following error:
2017-09-27 02:42:15 Error: Fatal Error (1): Class 'QrCode' not found in [C:\MAMP\htdocs\xxx\app\Controller\ActivitesController.php, line 971].
In this case the code looks like follows:
public function presta_my_space(){
App::import('Vendor', 'Endroid', array('file' => 'Endroid/QrCode/QrCodeInterface.php'));
App::import('Vendor', 'Endroid\QrCode', array('file' => 'Endroid/QrCode/QrCode.php'));
Endroid\QrCode is installed in /app/vendor/Endroid/QrCode.
Any idea about what is failing?
Thank you very much in advance.
You cannot include namespaced, composer based libraries like endroid/QrCode using App::import(), as this will only load a single file. Sure, you could load each and every single file manually, but that's anything but a good idea.
Switch your CakePHP application to using composer (back up your application before fiddling with this), and then ditch App::import() and use the library as shown in their docs.
See Cookbook > Installation > Advanced Installation
When I try to access the pdf file which is public using the angular-pdf-viewer I got the following error message on console.
Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 5 of the expression [http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf] starting at [://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf].
here is my pdf directive for rendering the pdf file:
<pdf-viewer delegate-handle="my-pdf-container" url="http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf" scale="1" show-toolbar="true" ></pdf-viewer>
could anyone help on this issue?
all the samples seems to be suggesting define url on scope and reference it. But you may try the following, which stringifys the url
<pdf-viewer delegate-handle="my-pdf-container" url="'http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf'" scale="1" show-toolbar="true" ></pdf-viewer>
I have been developing a website in CakePHP 2.5.6 and have suddenly had an issue where when using $this->Html->Image(''); the image wont display on the page and I get this error if I go to the Image URL Directly:
Missing Controller
Error: ImgController could not be found.
Error: Create the class ImgController below in file: app/Controller/ImgController.php
<?php
class ImgController extends AppController {
}
Notice: If you want to customize this error message, create app/View/Errors/missing_controller.ctp
As I haven't been using CakePHP for long im not sure where to start with resolving this, its never done this before to me.
Any help would be appreciated,
Steve
EDIT:
The example I have been using is this:
<?php echo $this->Html->image('cake.power.gif');?>
it returns the following:
<img src="/trunk/img/cake.power.gif" alt="" />
I have checked and the image does exist on my server in the directory app/webroot/img/cake.power.gif
In my Controller file i wrote the following code for attaching an image to the mail,But it gives an error
$email->attachments(array('/localhost/projname/app/webroot/img/file.png'));
It shows an error like File not found: ""
You can use the IMAGES constant to get the file path to the images folder:
$email->attachments(array(IMAGES.DS.'file.png'));
Finally I got solution for attaching Images
$email->attachments(array (
array('file'=>ROOT.'/app/webroot/img/car.gif',
'mimetype'=>'image/png'
),
));