cakephp

CakePHP - using $this->Html->link with $this->Html->image…generating ascii instead of actual HTML

試著忘記壹切 提交于 2020-02-18 13:58:14
问题 I'm using cakephp 2.3.0. I searched in the manual for quite awhile, but I haven't found the answer. I'm trying to use $this->Html->link, along with $this->Html->image. I'm trying to create the ability to click on an image. Any ideas as to why the ascii rendering of quotes is being generated? Here is my snippet codeset in my view ctp: echo $this->html->tableCells( array( array( array ( $this->Html->link($myActivity['Activity']['name'], array('controller' => 'users', 'action' => 'edit'), array(

What are the right ownership & permissions to the CakePHP app/tmp folder for production?

梦想与她 提交于 2020-02-17 07:24:51
问题 I would like to know the answers and explanation to the following questions: Which user/group should own the cake files? If different, which user/group should own the app/tmp folder? (and subfolders) With the right user/group, what are the correct permissions for production of both folders and files? (which also if set correctly should work on development) Where is storing of uploaded files done and what ownership/permissions need to be set to that folder. Where should it be relative to app/

cakephp 3 original data in afterSave

回眸只為那壹抹淺笑 提交于 2020-02-15 07:58:28
问题 Is there any way to access original data in afterSave? I would like to log the changes on important data. With $entity->isNew() I could check if it was an insert or an update, but how can I get what changed? 回答1: You can access the original values via Entity::getOriginal() or Entity::extractOriginal() . If you want to get all changed fields, combine the latter one with Entity::visibleProperties() , something like: debug($entity->extractOriginal($entity->visibleProperties())); This should

passing an javascript object from cakephp view to controller

冷暖自知 提交于 2020-02-08 07:25:49
问题 I am developing a website using cakephp, and I'd like to pass a javascript object in view back to the controller. I know that using a form could be easier but I need to do this customized. So here's the object ('annotation' and 'article_id' are real column names in the database, annotation and article_id are both variables containing data): var postdata = { 'annotation' : annotation, 'article_id' : article_id }; What method in the view should I use? Is it .post? And how should I program the

Echo String dont work properly

末鹿安然 提交于 2020-02-08 05:47:43
问题 I'm using cakePHP 2.x. I'm trying to render a view with an empty layout. The view should contain only a string returned from the action controller with no html code. Here is the code: public function checkout(){ $ref =null;$act=null;$par=null; $this->layout = false; //$this->render(false); //$priceCTP = $this->Session->read('priceCTP');; $priceCTP = $this->getPrice(); //var_dump(session_save_path()); if (isset($this->params['url']['Reference'])) { $ref = $this->params['url']['Reference']; }

How to prevent CakePHP 3.0 from extending session timeout with ajax requests?

僤鯓⒐⒋嵵緔 提交于 2020-02-08 02:28:09
问题 How can I prevent CakePHP 3.x from extending my users session when background ajax calls are made to the server? I am using jquery's $.ajax() as well. I have a setInterval running once a minute to get some user notifications. My application is an EHR and I need to maintain strict session timeout. My get notifications Javascript basically just made my sessions unlimited because the ajax calls are extending the sessions. I thought a saw something in the CakePHP book about this a few weeks ago

inserting only in two columns of database using cakephp

烈酒焚心 提交于 2020-02-06 07:29:26
问题 I have about 30 40 columns but only inserting in 2 columns to practice. Right now this is how i am inserting into database. UsersTable.php public function createUser($data) { $usersTable = TableRegistry::get('users'); $user = $usersTable->newEntity(); $user->first_name = $data['first_name']; $user->first_name = $data['first_name']; $usersTable->save($user); } and in the controller UsersController.php function signUp() { if($this->request->is('post')){ $data['first_name']='test first name';

inserting only in two columns of database using cakephp

寵の児 提交于 2020-02-06 07:28:50
问题 I have about 30 40 columns but only inserting in 2 columns to practice. Right now this is how i am inserting into database. UsersTable.php public function createUser($data) { $usersTable = TableRegistry::get('users'); $user = $usersTable->newEntity(); $user->first_name = $data['first_name']; $user->first_name = $data['first_name']; $usersTable->save($user); } and in the controller UsersController.php function signUp() { if($this->request->is('post')){ $data['first_name']='test first name';

check permission against group not users using Auth->authorize=“actions”

喜夏-厌秋 提交于 2020-02-06 03:51:26
问题 Can any one explain me the working of Auth->authorize = "actions" In my project i am planning tp give this. As this taught me the authorize will call the $this->Aro->check($user,"controllers/:controller/:action") This will check the against the user right?? that means the user should be there in aros table. But i don't need this to check against user but i need to check against a group How can i achive this. now when the users is not in Aro table it showing the So that The Aro's will be only

Cakephp 3 giving me Fatal error: Uncaught Error: Class 'Cake\Http\Server' not found

你说的曾经没有我的故事 提交于 2020-02-02 11:01:11
问题 I have done a cakephp 2 to cakephp 3 upgrade, and that was causing problems, so I found I had to replace the app/webroot with a new set of files that were part of the cakephp 3 skeleton, but now I am getting this error: Fatal error: Uncaught Error: Class 'Cake\Http\Server' not found in /usr/share/nginx/html/web/app/webroot/index.php:33 Stack trace: #0 /usr/share/nginx/html/web/index.php(47): require() #1 {main} thrown in /usr/share/nginx/html/web/app/webroot/index.php on line 33 After some