cakephp

Change input value based on another input's value

可紊 提交于 2021-01-27 11:43:36
问题 hope that title makes sense. I'm a noob at javascript. What I want to do is have a form which will have a couple of inputs like, name and url for example. When the user enters their name, I'd like the url input to automatically have as a default their name with an underscore between words. So if they type in as their name pedro kinkybottom then automatically set as the default in the url input would be pedro_kinkybottom. I'm using cakephp if anyone happens to know a particularly cakey way to

Cakephp3: Render/Evaluate HTML inside label formhelper

情到浓时终转凉″ 提交于 2021-01-27 04:21:53
问题 How you place html inside label in cakephp3? I need to achieve * Name: using the code below <?php echo $this->Form->input ( 'name', [ 'label' => [ 'text' => '<span class="red">*</span> Name:', 'class' => 'col-sm-12 col-md-2 col-lg-1 control-label' ], 'class' => 'form-control', 'rows' => 1 ] ); 回答1: Pretty much as always, use the escape option. echo $this->Form->input('name', [ 'label' => [ // ... 'escape' => false ], // ... ]); 来源: https://stackoverflow.com/questions/27991447/cakephp3-render

Missing/broken image after migration for Cake PHP

半世苍凉 提交于 2020-12-30 10:44:41
问题 I'm maintaining to exist project which migrated from another host. I'm facing this issue where the image from app/media/tf/img/ are broken whereas from other path are working fine. Below are stack trace from error.log 2020-12-04 16:44:47 Error: [MissingControllerException] Controller class TransferController could not be found. Exception Attributes: array ( 'class' => 'TransferController', 'plugin' => 'Media', ) Request URL: /xy/media/tf/img/123.jpg Stack Trace: #0 E:\www\xy\xy\app\webroot

Missing/broken image after migration for Cake PHP

耗尽温柔 提交于 2020-12-30 10:44:31
问题 I'm maintaining to exist project which migrated from another host. I'm facing this issue where the image from app/media/tf/img/ are broken whereas from other path are working fine. Below are stack trace from error.log 2020-12-04 16:44:47 Error: [MissingControllerException] Controller class TransferController could not be found. Exception Attributes: array ( 'class' => 'TransferController', 'plugin' => 'Media', ) Request URL: /xy/media/tf/img/123.jpg Stack Trace: #0 E:\www\xy\xy\app\webroot

How can I set the samesite cookie attribute in CakePHP 2.3?

流过昼夜 提交于 2020-12-15 06:38:34
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

How can I set the samesite cookie attribute in CakePHP 2.3?

余生长醉 提交于 2020-12-15 06:38:17
问题 CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None and Secure=true for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options: Session.cookie - The name of the cookie to use. Defaults to 'CAKEPHP' Session.timeout - The number of minutes you want sessions to live for. This timeout is handled by CakePHP Session.cookieTimeout - The number of minutes

How do I get the Bake console for CakePHP?

半腔热情 提交于 2020-12-15 06:08:20
问题 I am having trouble getting the Bake console. I am on Windows running XAMPP. I'm doing the IBM CakePHP tutorial. Here is my directory: C:\ xampp htdocs ibm2 (a test project - orginally called cakephp) app cake vendors (etc) It says to use Bake, cd into the /webroot/app directory and launch the Cake Console: ../cake/console/cake bake. You should be presented with a screen that looks like Figure 2. So I write in my command prompt till I am at: C:\xampp\htdocs\ibm2\app> Then I type ../cake

CSS / JS / Images not loading from a different directory than main webroot in CakePHP

给你一囗甜甜゛ 提交于 2020-12-07 13:29:21
问题 I have been working on a CakePHP App, most of the CSS / JS / images (icons) are located in the webroot directory (/var/www/app/webroot/), but for some portion (Croogo) or other pages of the app, I need to load CSS / JS / images from a different directory i.e /var/www/app/views/themed/admin/webroot/. Now the issue I am facing is that when I render these other pages the css / JS / images requests return 404 page not found status, as these requests are made to main webroot rather than the

How to declare the type for local variables using PHPDoc notation?

二次信任 提交于 2020-12-04 14:37:48
问题 I use Zend Studio to develop in PHP with CakePHP, and one of the problems with CakePHP is that the views all reference undeclared local variables. So for example, in the controller you would $this->set('job',new MyJobObject()); Then in the view you could echo $job->getName(); My problem is that Zend Studio can't perform autocomplete on $job , because it's type is unknown. Now there are PHPDoc tags that allow you to declare the type so that IDE's can perform autocomplete. The @var tag for