i use cakephp and i am beginner
i use
$this->requestElement()
in
default.ctp
file but i face error.
but when use
$this->element()
my problem solved.
i face question that what is difference between $this->requestElement() and $this->element();
when i use requestElement() and when i use element() ?
thanks for help.
requestElement is outdated/deprecated (was used prior to 1.3).
you should now use element()
I'm not sure where you've found the method requestElement() but I can't find it in the API documentation. If the method ever existed it's likely been deprecated in later versions of Cake.
Or did you mean requestAction()?
You probably mean renderElement instead of requestElement. renderElement was deprecated in CakePHP 1.2, and has been removed in later versions.
Related
I'm using SkyAPM.Agent.AspNetCore 1.1.0, and I need to get the trace id in my code and do something.
However, I didn't find enough information anywhere. Any suggestion?
Seems I found the solution from the source code.
First inject the IEntrySegmentContextAccessor in the constuctor, then get the traceId by _entrySegmentContextAccessor.Context.TraceId
I have updated my cakePHP application to 3.1 through composer, and I'm trying to fix all the small or deprecated warnings.
I could easily fix the $this->layout stuff but I don't understand how to fix viewPath errors.
Looking at the migration guide it looks like it should be exactly the same thing:
$this->viewPath = 'Element';
should become
$this->viewBuilder()->viewPath('Element');
But this is not working, and the only thing that I get is
Error: Call to undefined method Cake\View\ViewBuilder::viewPath()
File /var/www/myapp/src/Controller/InvoicesController.php
Line: 375
What is the correct way to fix this?
From the very same migration guide, in the View section of it:
View::$viewPath is deprecated. You should use View::templatePath() instead.
Guess it's now:
$this->viewBuilder()->templatePath('Element');
We have migrated code from Yocto1.5 to 1.7 and it seems with using the same configuration file(local.conf), I found that a lot of libraries previously installed on the 1.5 image(fsl-image-gui) was not present in the 1.7 image(core-image-sato)
I have manually added most of the packages except for two
libbeecrypt_cxx.so
liblcms.so(cmsutil)
I have already put in the code below and libbreecrypt was insalled but not libbeecrypt_cxx
IMAGE_INSTALL_append += beecrypt
I have not found a recipe/package for cmsutil. Anyone information regarding these would be appreciated.
Best Regards
Yuri
Well, regarding the beecrypt part of your question. Shortly after the 1.5 release, building the c++ bindings were made optional, and defaults to off.
See patch making c++ optional
Thus, what you need is to add a beecrypt_4.2.1.bbappend file in your own layer which includes
PACKAGECONFIG += "cplusplus"
That the best, longterm solution. You could also set
PACKAGECONFIG_pn-beecrypt_append = "cplusplus"
in your conf/local.conf.
I have noted that BasicAuth does no longer works by simply uncomented //->check in Frontend.php
It seems like now it requires a Model...
what are the requirements for that model? how do I create it?
And how do I know use BasicAuth?
Thanks
$auth->setModel('AnyModel','user_field','password_field');
$auth->check();
This should work. The allow('demo','demo') attempt to pass on a Array-based model with specified user and there seems to be some bug in 4.2.1.
Added: https://github.com/atk4/atk4/issues/67
I have upgraded my Xampp to newer version(1.7.2).But right now when I run my project(done in CakePHP) it is throwing bug saying
Deprecated: Assigning the return value of new by reference is deprecated in
C:\xampp\htdocs\ebayn\cake\libs\debugger.php on line 99
Deprecated: Assigning the return value of new by reference is deprecated in
C:\xampp\htdocs\ebayn\cake\libs\debugger.php on line 108
Deprecated: Assigning the return value of new by reference is deprecated in
C:\xampp\htdocs\ebayn\cake\libs\file.php on line 96
Deprecated: Assigning the return value of new by reference is deprecated in
C:\xampp\htdocs\ebayn\cake\libs\cache\file.php on line 89
Can anyone help me how can I rectify this stuff....???
Thanks In Advance
You need to patch the cake/libs/configure.php and find the line "error_reporting(E_ALL);" replace that line with the following:
error_reporting(E_ALL & ~E_DEPRECATED);
You may need to change this in your app/webroot/index.php and respectively test.php, too.
There is currently no better way than to touch the core.
You don't mention your CakePHP version, but if you use PHP 5.3 (which is part of Xampp 1.7.2) then you have to use CakePHP 1.3.x.x.
You haven't included any code, but it looks like you may be attempting to assign a variable by reference - probably an instance of an object. In PHP 5+, that's the default, as I recall. In 5.3, they may have officially deprecated the practice.
If your app has to work with PHP 4, you may want to look at your error_reporting setting. If E_STRICT is set, turn it off. I don't recall which settings effect which types of errors, but that particular value will probably be instructive if I were to guess.
I found I needed to roll PHP 5.3 back to php 5.2 in MAMP in order to run Cake 1.2.
Need to get a local copy of an old client site throwing useful errors, instead of just an Internal Server Error.
Progress...