Virtual fields problem

2016-03-10 Thread Sam Clauw
Hi 2 all, I'm working on my first CakePHP blog project: http://kattenbelletjes.be/ As you can see, there's a footer section that shows the top 25 most popular tags. There are three relevant tables I use the implement those popular tags: POSTS: id, title, content, slug TAGS: id, name, slug POST_

CakePhp 2.x Generate tree for Tree Behavior?

2016-01-10 Thread Sam Clauw
A very simple question: is there a way to get an associative array with tree nodes build with CakePHP's Tree Behavior? I can only find a method that output an array to use in a dropdown field ... -- Like Us on FaceBook https

CakePHP 2.x Persistent virtual fields problem

2015-11-29 Thread Sam Clauw
I have a brainteaser about virtual fields on associated models. I know it has it's limitations as you can read here: http://book.cakephp.org/2.0/en/models/virtual-fields.html#limitations-of-virtualfields . But in my specific case, I can't apply the theory of passing the virtualField property fr

Re: Plugin appController beforeFilter() action doesn't work anymore

2015-11-28 Thread Sam Clauw
I didn't find out which release changes caused the problem. But yesterday, I finally got the answar. When I changed the "beforeFilter" tot "beforeRender", it worked again! Thanks anyway for the help! Op donderdag 22 oktober 2015 12:13:17 UTC+2 schreef Rob Maurer: > > There are changes made with

CakePHP environment plugin doesn't work

2015-11-22 Thread Sam Clauw
I've made a CakePHP application and would like to integrate the environments concept. So my app should check the current domain name and then automatically determine if the environment is... 1. Development: http://development.bellewaerdefun.be 2. Staging: http://staging.bellewaerdefun.be 3. P

Plugin appController beforeFilter() action doesn't work anymore

2015-10-21 Thread Sam Clauw
Since my update from CakePhp 2.3. to CakePhp 2.7., my beforeFilter() action in pluginAppController doesn't work anymore: array( 'loginAction' => array( 'plugin' => 'coaster_cms', 'controller' => 'users', 'action' => 'login'

JSON string is showed instead of used

2015-05-31 Thread Sam Clauw
I recently added jQuery file upload (https://github.com/blueimp/jQuery-File-Upload) to my custom-made CMS system. Uploading images works fine, but loading the uploaded images doesn't. In fact: the JSON string appears on top of my file: {"files":[{"name":"foto1.jpg","size":221882,"url":"D:\\Webs

Re: Form width fieldset and different button types

2015-05-19 Thread Sam Clauw
FormHelper::inputs does create more than only input elements. I have forms where I've included textareas and selects in it. So I hoped we could also put some submit and reset buttons in it ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP -

Form width fieldset and different button types

2015-05-18 Thread Sam Clauw
Hi there! I'm trying to use the jquery file uploader in combination with CakePHP. The HTML form uses 3 different button types: - submit (Start upload) - reset (Start upload) - button (Start upload) With CakePHP, I try to create tho

What are the advantages in using composite primary key since it has been supported in cakephp v3?

2015-04-29 Thread Sam
Cakephp 2.x did not support composite primary keys and it worked pretty fine. Cakephp 3.x added support for composite primary keys. I am not knowledgeable enough to know what are the advantages in using composite primary key. When should we use composite primary key? -- Like Us on FaceBook htt

What are the improvements made on Cakephp ver3.x over the older versions?

2015-04-28 Thread Sam
I have used Cakephp ver2.x in the past and am pretty happy about it. Not sure if I should upgrade to ver3.x. May I know what are the improvements made in ver3.x compared to ver2.x? Any compelling improvements? So far, what are the grumbles, if any, with users who migrated from 2.x to 3.x? -- L

Re: File upload validation

2015-03-01 Thread Sam Clauw
Charles, thank you for the great effort! But is there no other option than move the validation into the controller instead of doing it in the model? The code I wrote only contains one single if/else and is very clear to me. Okay, it's not working so I'm not getting anywhere for the moment huh ;)

Re: File upload validation

2015-02-28 Thread Sam Clauw
Okay Charles , that makes sense so I changed my code: array( 'rule' => 'notEmpty', // verplicht 'message' => 'Nameis required.', 'allowEmpty' => true ), 'intro' => array( 'rule' => 'notEmpty', // verplicht 'message' => 'I

File upload validation

2015-02-28 Thread Sam Clauw
I have a problem with my file upload validation in CakePHP. When I add a new record with an image upload field... - ... image should be required. - ... image file extension sould be jpg, png or gif. When I edit an existing record with an image upload field... - ... image is not require

Problem with creating routes

2014-12-26 Thread Sam Clauw
I have a simple project that I'm trying to convert to a CakePHP project: http://optiekcardoen.be/home The page navigation is very simple: - Home (/) - Shop (/shop) - Products (/products) - Frames (/products/frames) - Sunglasses (/products/sunglasses) - Lenses (/products/lenses) -

Re: Custom name for dropdown generated by formhelper

2014-12-12 Thread Sam Clauw
Is there no one who can help me out with this? ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receivi

Is there a way to put request variables in paginate class property?

2014-11-30 Thread Sam Clauw
I want to sort an array of data in my index action and one condition depends on the id given by the request object (attraction_id). Is there a way to set up the paginate component as a controller class method (see under)? array( 'conditions' => array( 'Attraction.id

Custom name for dropdown generated by formhelper

2014-11-22 Thread Sam Clauw
I'm building a CMS system with a module called "CmsPage' (list, add, edit, sort delete). Every cms page links via a to another cms page and it tells which record the parent cms page is. The select dropdown holds all the values from the table "cms_pages". Here's my *add.php* with the form helpe

Question about using a CakePHP behavior

2014-11-19 Thread Sam Clauw
When you work with a self-made behavior and you create a public method in it, the first parameter should always be "Model" (predefined by CakePHP itself). Why is that? I prefer to do a setter in the construct method of that behavior so I can call my model by $this->model... -- Like Us on FaceB

Is it a good idea to put AngularJS webpages onto Page folder?

2014-10-20 Thread Sam
I am currently using Cakephp mainly as REST server and AngularJS. The Angularjs webpages are put under webroot folder. Things have been working fine until I added user login authentication in Cakephp. For unauthenticated users who visit webpages in webroot, they are not directed to a login page

Re: Web service login function to check authenticate user in cakephp

2014-10-10 Thread Sam
It is cakephp 2.5 On Saturday, October 11, 2014 9:53:21 AM UTC+8, Matthew Kaufman wrote: > > Is this Cake 2.6 or 3? > > On Fri, Oct 10, 2014 at 5:33 PM, Sam > > wrote: > >> I am writing a web service to authenticate whether a user login is valid >> or not. Be

Web service login function to check authenticate user in cakephp

2014-10-10 Thread Sam
I am writing a web service to authenticate whether a user login is valid or not. Below is a simple implementation of the web service placed inside UsersController.php public function webservice_login() { $this->autoRender = false; if ($this->request->is('post')) { if ($

Re: Best practice to get menu array

2014-09-18 Thread Sam Clauw
Can I bump my topic again? :) I realy hope I'll find an answer on this one, it's all about keeping the MVC as clear as possible ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to t

Best practice to get menu array

2014-09-13 Thread Sam Clauw
I have 2 tables which hold pages information: "pages" and "cms_pages". Now I want to build a menu on every website page with the records within. What's the best practice for this? Should I make a behavior that loads in the "pages" and "cms_pages" model? If yes, where (and how) should I make the

Re: Make AppController variable available in pluginAppController

2014-09-12 Thread Sam Clauw
Okay, that's some basic stuff that I totally forgot! Thanks, it works fine now! ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscrib

Make AppController variable available in pluginAppController

2014-09-06 Thread Sam Clauw
In the AppController, I want to put the plugin, controller and action in variables just like this: class AppController extends Controller { public $components = array( 'DebugKit.Toolbar', 'Session' ); public function beforeFilter() { $plugin = $this->r

How to convert this php array into xml?

2014-08-21 Thread Sam
I am using cakephp v2.5. I would like to convert an array into xml. The array looks like this; $Items = array( (int) 0 => array( 'Item' => array( 'id' => '2' ) ), (int) 1 => array( 'Item' => array( 'id' => '4' ) )) To conv

Re: Best practice: using class on all pages

2014-08-14 Thread Sam Clauw
Okay, outputting an structure with an element is indeed very usefull. It can appear in multiple areas on the template files. I understand that I should do something like: echo $this->element('mainmanu', array( 'tree' => array(...), 'active' => array(...) )); The tree array holds the re

Best practice: using class on all pages

2014-08-10 Thread Sam Clauw
I want to write a class that use a left value and a depth value so it can print an output for a menu. I want it to be able in my CMS plugin AND in my front-end pages. My question is: where should I put that class? Some options I've been thinking on: 1. Everything in AppModel.php (disadvanta

Re: Authentication redirect problem when not logged in

2014-08-08 Thread Sam Clauw
Okay, leave it guys! When I've posted my previous question, I suddenly realised that my database structure reserved 50 characters for the password field instead of 60. When changing this, it's all working great. Thanks anyway!!! Op vrijdag 8 augustus 2014 12:11:38 UTC+2 schreef

Re: Authentication redirect problem when not logged in

2014-08-08 Thread Sam Clauw
Aha, a combination of you posts solved this problem ;) However, I've got another one when trying to log in now. The password comparing doesn't work. The password values in my database are build up with the Blowfish hasher. When I'm submitting my login form, it compares the text value of the pas

Authentication redirect problem when not logged in

2014-08-06 Thread Sam Clauw
I reached the authentication part of my CakePHP based cms system, things are going very well (thanks to you guys) ;) As in every application, I should ask for a username / password combination when somebody tries to get into my CMS. This CMS is build as a plugin and is called "CoasterCms". Witho

Re: Issue with COUNT() as query field

2014-07-29 Thread Sam Clauw
Sorry, my bad! I forgot to change the virtual field declaration to $model->virtualFields['depth'] = 0; Thanks anyway ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Googl

Re: Issue with COUNT() as query field

2014-07-29 Thread Sam Clauw
That does the trick for me, thx a lot! BUT, I found out that when you use it in a behavior: it won't work at all. The array is shown as when you don't use the virtual fields: array( > (int) 0 => array( > 'CmsPage' => array( > 'id' => '2', > 'name' => 'Pagina's', > 'lft' =>

Re: Behavior method won't work

2014-07-28 Thread Sam Clauw
Okay, I think I got it. I've made a single function as you suggested. *Controller* public function delete($id) > { > if ($this->request->is('get')) { > throw new MethodNotAllowedException(); > } > > $this->Attraction->id = $id; > >

Re: Behavior method won't work

2014-07-27 Thread Sam Clauw
Allright, I should know that, you're totally right! It works for my now, except my flash error of course. I could put it outside the if ($this->Attraction->delete($id)) {} check, but then the flash would always been shown, even if there was no delete... -- Like Us on FaceBook https://www.faceb

Re: Behavior method won't work

2014-07-27 Thread Sam Clauw
Well, the weird thing is that's how I originally wrote it, and that won't work. An illustration of how it all looks right now: *Controller (AttractionsController.php)* public function delete($id) { if ($this->request->is('get')) { throw new MethodNotAllowedException(); } $th

Re: Behavior method won't work

2014-07-27 Thread Sam Clauw
Hmmm, that doesn't work out for me. It seems that it tries to execute a query: *Error: *SQLSTATE[42000]: Syntax error or access violation: 1064 You have > an error in your SQL syntax; check the manual that corresponds to your > MySQL server version for the right syntax to use near 'referer' at

Re: Behavior method won't work

2014-07-27 Thread Sam Clauw
Okay, that was very helpful, thanks! I've moved the functionality to AppModel now and it works. One other additional problem: the application expects a view file now: *Error: *The view for *AttractionsController::**delete()* was not found. How can you prevent it from loading a view file? :) --

Cakephp Webservice

2014-07-26 Thread Engleang Sam
Dear All, I have problem with saving image that upload from IOS objective C. My friend does it with AFnetworking , framework of objective-c while I could not find any files to save in Cakephp. Any solution or comment would be appreciated! Best regard, Engleang -- Like Us on FaceBook https:/

Behavior method won't work

2014-07-26 Thread Sam Clauw
I'll try to write my very first behavior that does a soft delete instead of a hard delete. I've expanded my model with public $actsAs = array('SoftDelete'); and I've created the behavior "SoftDeleteBehavior.php" in App/Model/Behavior: > App::uses('ModelBehavior', 'Model'); > class SoftDel

How to calculate in array from $this->model->updateAll()?

2014-07-17 Thread Sam Clauw
I try to do an "update all" in my add action with the following method: $this->CmsPage->updateAll( > array( > 'CmsPage.rgt' => *('CmsPage.rgt' + 2)* > ), > array( > 'CmsPage.rgt >' => $right > ) > ); Unfortunately, i'ts not working. It keeps sending the value "2"

Issue with COUNT() as query field

2014-07-08 Thread Sam Clauw
What I'm trying to do is making a self join to get a menu tree structure out of the database. It almost works with this code: $this->set('cmsPages', $this->CmsPage->find('all', array( 'fields' => array( 'CmsPage.name', 'CmsPage.lft', 'CmsPage.rgt', '(COUNT(CmsP

Re: Cookbook: database query in controller???

2014-07-07 Thread Sam Clauw
Okay, that's very clear to me. Thanks a lot guys!!! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop recei

Cookbook: database query in controller???

2014-07-06 Thread Sam Clauw
I've a question about the MVC in CakePHP. Normally, the model should take responsability for all the database queries. However, in the cookbook documentation, it seems this isn't respected. See the following link: http://book.cakephp.org/2.0/en/getting-started.html#create-a-posts-controller As

Uploading a picture file from mobile app to Cakephp

2014-07-02 Thread Sam
I would like have an Android mobile app snap pictures and then upload the pictures to a Cakephp web application. Is creating web services on Cakephp for the mobile app to call to upload the image file the right approach? Is it possible to have the mobile app do a HTTP Post to upload the file?

Re: How to self join?

2014-06-16 Thread Sam Clauw
Well, it seems there are 2 problems with you suggested query. Here's the SQL error I've got: *Error: *SQLSTATE[42S22]: Column not found: 1054 Unknown column > 'CmsPage.null' in 'on clause' > *SQL Query: *SELECT `CmsPage`.`id`, `CmsPage`.`parent_id`, > `CmsPage`.`name`, `CmsPage`.`lft`, `CmsPag

How to self join?

2014-06-15 Thread Sam Clauw
Hi there, what I try to do is to make a self join in my controller. The only problem is I can't find any documentation about it in the cookbook 2.x about it. My "uncaked" query looks like this: SELECT node.name, (COUNT(parent.name) - 1) AS depth FROM cms_pages AS node,

How to get URL parameters in cakephp with URL that ends with xml?

2014-06-04 Thread Sam
I would like to pass URL parameters in cakephp with URL that ends with xml like below; http://localhost/cp251/controller/api_get_info?page=1.xml The controller function looks like this; public function api_get_info(){ if($this->RequestHandler->responseType() == 'xml') { //Prob

Redirect all webpages under webroot to login page

2014-05-15 Thread Sam
I am using cakephp 2.4.5. I would like to redirect all users who have not logged in to a login page. I basically followed the instructions here http://miftyisbored.com/a-complete-login-and-authentication-application-tutorial-for-cakephp-2-3/ In summary, the important part is the following code

How to redirect all webpages under webroot to login page?

2014-05-15 Thread Sam
I am using cakephp 2.4.5. I would like to redirect all users who have not logged in to a login page. I basically followed the instructions here http://miftyisbored.com/a-complete-login-and-authentication-application-tutorial-for-cakephp-2-3/ In summary, the important part is the following code

Re: Multi-level menu with Modified Preorder Tree Traversal

2014-04-06 Thread Sam Clauw
Hi Marco, thanks 4 your answer too! I realy do appreciate those great scripts you're sending to me. But right now, I still got the problem that I can't write the essence of a multi-level menu (without recursion) on my own ;) Perhaps, you can tell me if / how I can cross my tree-based database ta

Re: Multi-level menu with Modified Preorder Tree Traversal

2014-04-01 Thread Sam Clauw
Hi euromark, I did noticed your article, but I don't want to put the whole Tools plugin into my system... In fact, the most important thing is that I can code such a tree by myself (and with soms exterial forum help of course) ;) -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us

Multi-level menu with Modified Preorder Tree Traversal

2014-03-31 Thread Sam Clauw
Hi all, In this well known example, the indention of the levels is done by some  's instead of 's. I wonder if there's a way to use MPPT (Modified Preorder Tree Traversal) logic to dynamically build those multi-level menu without using an

What are the pros and cons of using find() versus SQL queries?

2014-03-27 Thread Sam
What are the pros and cons of using find() versus SQL queries? If one is already familiar with SQL, is it advisable to use them throughout in cakephp? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because yo

Moving data from 1 pair of table to another similar pair

2014-03-25 Thread Sam
I have 2 similar pairs of tables (Table1 and Table2, TableA and TableB). Table1 has many Table2. Table2 belongs to Table1. In other words, there is a one-to-many relationship between Table1 and Table2. TableA and TableB has the same one-to-many relationship as Table1 and Table2. I would like

How to remove element from json web service when using _serialize in Cakephp?

2014-03-18 Thread Sam
Cakephp _serialize() automatically appends a element when it is used to generate a json web service. This element causes problem for the front-end to parse. How can this element be removed from Cakephp? I am using Cakephp 2.4.5 http://book.cakephp.org/2.0/en/views/json-and-xml-views.html

Re: How to return json message inside controller?

2014-03-13 Thread Sam
Are those cakephp debug messages? Can I remove them by setting the debug level down? > Wladimir Chópite > +584249700264 > ve.linkedin.com/in/wchopite > "Mejor pirata de la armada". Hack the planet! > El 13/03/2014 06:57, "Sam" > escribió: > >> &

Re: How to return json message inside controller?

2014-03-13 Thread Sam
you. > Wladimir Chópite > +584249700264 > ve.linkedin.com/in/wchopite > "Mejor pirata de la armada". Hack the planet! > El 13/03/2014 06:45, "Sam" > escribió: > >> I have a controller which takes in an id and checks whether this id >> exists inside the Mod

How to return json message inside controller?

2014-03-13 Thread Sam
I have a controller which takes in an id and checks whether this id exists inside the Model. If it does not exist, I would like the controller to return a validation error message "id not found" in json when it returns the HTTP response. This controller takes in a normal HTTP POST which is not

Re: What HTTP POST format to use for saving model and associated model data in a single controller function?

2014-03-12 Thread Sam
ata[TableB][0][field2] = field2_value > > On Wednesday, March 12, 2014 10:38:00 AM UTC+1, Sam wrote: >> >> I am using Cakephp 2.4.5. I have 2 tables with a one-to-many >> relationship. Table B belongs to Table A. Table A has many Table B. >> >> I want a controller in

What HTTP POST format to use for saving model and associated model data in a single controller function?

2014-03-12 Thread Sam
I am using Cakephp 2.4.5. I have 2 tables with a one-to-many relationship. Table B belongs to Table A. Table A has many Table B. I want a controller in Table A that can save records in Table A and Table B. The controller code should be simple and looks like this; public function add_tableA($i

How to send HTTP POST in non-json and get HTTP response in json?

2014-03-11 Thread Sam
I want to add records to a table using a normal HTTP POST. The payload will look something like data[Model][fieldName]. The HTTP Post is done in json format. However, I would like the HTTP Response which contains the data validation message to be in json format. Currently, Cakephp will return

How to update data in several models in a single Web Service?

2014-03-08 Thread Sam
There are 3 tables in my database. Table1 has a one-to-many relationship to Table2. Table2 has a one-to-many relationship to Table3. I would like to write a web service API that allows the user to add rows to all 3 tables at the same time. The problem with CakePHP is that it only allows a contro

What are the advantages and disadvantages(if any) to use cakephp3.0?

2014-02-28 Thread Sam
What are the advantages and disadvantages(if any) to use cakephp3.0 instead of cakephp2.x? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To un

Re: Dynamic menu content in layout

2014-02-26 Thread Sam Clauw
Okay, let's suppose I want to put my menu in an element called "top_menu.ctp". I want to get my data out of the database, so probably, I shouldn't connect with my database in that .ctp file. I wonder if that's the right way to do so? MVC normally split us the model logic and the view logic, but

How to copy a record and its associated records to another 2 tables?

2014-02-25 Thread Sam
I have 2 tables with a one-to-many relationship. I have another 2 similar tables with the same relationship in the same database. I would like to copy a record and its associated records from one pair to another. Can someone advise? Thank you very much. -- Like Us on FaceBook https://www.face

Any problems if foreign key is defined in the table creation SQL script?

2014-02-23 Thread Sam
In cakephp, the table relationship is defined in the Models and no foreign key needs to be defined in the table creation SQL script. However, I have a SQL script created using MySQL workbench that defines the foreign key. Will this be a problem in cakephp? -- Like Us on FaceBook https://www.fa

Dynamic menu content in layout

2014-02-22 Thread Sam Clauw
What I'm trying to do is to put two dynamic navigation menus in my CakePHP layout (default.ctp). The main menu should have multiple levels (with a dropdown functionality). The secondary menu is the one that shows the dropdown content of the main menu in a left sidebar. I've read the CakePHP d

How to write custom SQL queries instead of using find()?

2014-02-20 Thread Sam
While find() is good enough for most, I would like to write custom SQL queries instead of using find(). How can that be done in cakephp? Thank you. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you a

Can HTTP POST response size be minimized?

2014-02-12 Thread Sam
I have an application which sends plenty of HTTP POST to add records to a cakephp 2.3 application which was cake baked. I noticed that the HTTP response from cakephp is quite big. Can HTTP POST response size be minimized? I don't really care about the response. Please note that I am not sendi

How does HTTP Post URL for adding multiple records look like?

2014-02-10 Thread Sam
Dear CakePHP gurus, I would like to add multiple records to a single model in a single HTTP post. For single record, the HTTP post will look something like "http://127.0.0.1/app/model/api_add/data[Model][Field1]";. How will the HTTP Post URL look like for adding multiple records? I will tried d

Paginator isn't sorting

2014-02-09 Thread Sam Clauw
I would like to sort my index list on sequence ASC, but it won't work. If I see the query setup in the CakePHP docs (http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html#query-setup), my paginator settings should look like this: public function index() > { >

Re: Date modified isn't null when adding a record

2014-02-09 Thread Sam Clauw
Okay, that's totally clear to me now. At first sight, I thought there shouldn't be a "date modified" when adding a record. But that's the second system that do save a "date create" and a "date modified" when adding a record. Thanks 4 the clarification! -- Like Us on FaceBook https://www.facebo

Date modified isn't null when adding a record

2014-02-09 Thread Sam Clauw
Normally, when you add a record with a form to a database table, CakePHP will automatically fill in the "created" field in de database with the current date & time. It works for my table called "attractions" (model "Attraction"). But now, strange things are happening. When I add a record for:

Re: jQuery sortable: how to update database?

2014-02-02 Thread Sam Clauw
Indeed Euromark, that was the reason it didn't work. I changed the notation too so I have an up-to-date program running;) Salines & Euromark: thank you for helping me with this issue, I *realy*appreciate this! I can go further exploring CakePHP now! :) -- Like Us on FaceBook https://www.faceboo

Re: jQuery sortable: how to update database?

2014-02-02 Thread Sam Clauw
Allright, that will be much easier to understand the whole AJAX and request happening! Last years, I've realy struggled with this and I think it will be a lot clearer for me now. Thank you! To go back on my sorting problem: it isn't working yet. I dugged into CakePHP's Request Handling documenta

Re: jQuery sortable: how to update database?

2014-02-01 Thread Sam Clauw
Ow yes, you've got me on the right way! I've changed my .ctp file now: $(function() { $('.sortable tbody').sortable({ axis: 'y', scroll: true, opacity: 0.5, revert: 100, cursor: 's-resize', items: 'tr.grab',

jQuery sortable: how to update database?

2014-02-01 Thread Sam Clauw
Hi there! I've made a sortable table in my custom CMS system. You can drag and drop 's so they have another position. This is the javascript in my sort.ctp file: $(function() { $('.sortable tbody').sortable({ axis: 'y', scroll: true, opacity: 0.

Adding authentication to REST API server?

2014-01-31 Thread Sam
I would like to add authentication to a REST API server developed with cakephp. Are there any links or tips that I can use for a start? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed

CakePHP's naming conventions on hasMany through (The Join Model)

2014-01-31 Thread Sam Clauw
After struggling with this inconvenience for a couple of weeks now, I've decided to open en now topic here. A topic that can help me, but I'm sure it will help some others with this same problem too! I wonder how I should name the tables, controllers and models of a hasMany through table (thus

Re: Problem with year dropdown

2014-01-30 Thread Sam Clauw
Allright, thank you very much, that's the dropdown I was looking for! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this gr

Re: Problem with year dropdown

2014-01-28 Thread Sam Clauw
Is there nobody who can help me with this? Could it be possibile dat the datebase field type "year" isn't supported in CakePHP? If yes, what should I use instead? Varchar or...? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You recei

Problem with year dropdown

2014-01-23 Thread Sam Clauw
Hi guys! I have a dropdown where you can choose an opening year of a themepark attraction. Database Column: opened Type: year(4) Null: no Standard value: none So far so good. Now I try to display a dropdown with year values between 1954 (opening park) and the current year + 1. edit.ctp echo

hasMany through: my neverending problem?

2014-01-22 Thread Sam Clauw
I have two tables: "attractions" & "accessibilities". I want to display which people can go on which rides so I invented a new, joined table called "accessibilities_attractions". Here's a visual representation of it:

Re: Will combining cakephp with web templates like Smarty or Twig make front-end coding easier?

2014-01-20 Thread Sam
f preference. Here you have a CakePHP plugin for > working with Twig: > > https://github.com/WyriHaximus/TwigView > > On Monday, January 20, 2014 4:32:03 PM UTC+1, Sam wrote: >> >> Cakephp is good for back-end work. Web templates like Smarty or Twig is >> used for fr

Will combining cakephp with web templates like Smarty or Twig make front-end coding easier?

2014-01-20 Thread Sam
Cakephp is good for back-end work. Web templates like Smarty or Twig is used for front-end work. Will combining cakephp with web templates like Smarty or Twig make front-end coding easier? Is this advisable and has it been done before? -- Like Us on FaceBook https://www.facebook.com/CakePHP Fi

Re: Does the choice of framework matter to ease of ajax dynamic front-end coding?

2014-01-20 Thread Sam
s? Do you need any extra tips on how to use ajax > in cakephp? > > On Monday, January 20, 2014 3:58:41 PM UTC+1, Sam wrote: >> >> I have an upcoming project which may use lots of ajax dynamic front-end >> features. Does the choice of framework matter to ease of ajax dyn

Does the choice of framework matter to ease of ajax dynamic front-end coding?

2014-01-20 Thread Sam
I have an upcoming project which may use lots of ajax dynamic front-end features. Does the choice of framework matter to ease of ajax dynamic front-end coding? I have never used ajax before, so I am kind of nervous at whether cakephp would be the right choice or if there is a simpler framework.

Is it possible for a View to access another unrelated Model's data?

2014-01-19 Thread Sam
>From what I understand from cakephp, a view is associated to a model and can only access the model's data. Is it possible for a View to access another unrelated Model's data? What I mean is whether it is possible for a view to access any database table's data, even if it is unrelated? -- Like

Pros and cons of Cakephp versus Laravel

2014-01-19 Thread Sam
Dear Cakephp gurus, I have used cakephp in a past project (simple one) and I would like to continue using cakephp in a new project. There are some voices which advocate using Laravel which is an up-and-coming php framework. For experienced programmers who know something about both frameworks,

Is it possible to do watch window debugging of cakephp code?

2013-12-31 Thread Sam
Are there any debugger that allows one to trace our code on a watch window for cakephp? Thank you. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" gro

Sample code for cakephp jquery edit-in-place tables

2013-12-13 Thread Sam
I would like to implement some excel-like tables for data entry using cakephp. Are there any sample code for cakephp that uses jquery to edit table? Thank you very much. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received thi

Updating data in real-time on table using Cakephp-DataTables

2013-10-29 Thread Sam
I stumbled onto a good tool that simplifies using jquery datatables on cakephp. (Demo website cakephpdatatables.cnizz.com). However, I would like to update my data in real-time because my data is live and changes by the minute. Can someone point me to some samples on the internet or some place

Re: Is it possible to retrieve webroot folder location in Javascript?

2013-10-29 Thread Sam
I use the following webroot; ?> to retrieve the webroot location in cakephp. I wonder how one can use Cakephp to retrieve webroot location in Javascript. On Wednesday, October 30, 2013 7:08:30 AM UTC+8, Sam wrote: > > I am writing javascript with jquery currently. Is it possible to

Is it possible to retrieve webroot folder location in Javascript?

2013-10-29 Thread Sam
I am writing javascript with jquery currently. Is it possible to retrieve webroot folder location in Javascript? This will be good if webroot changes in future. Thank you. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received t

Re: Can the same web app mix cakephp with non-cakephp code?

2013-10-11 Thread Sam
; > On 11 Oct 2013, at 16:47, Sam > wrote: > > Is it possible for the same web app to mix cakephp with non-cakephp code? > Some pages of a website can use cakephp and others use non-cakephp code. > Can this be done? > > > yes it is. although you'd be be better movi

Can the same web app mix cakephp with non-cakephp code?

2013-10-11 Thread Sam
Is it possible for the same web app to mix cakephp with non-cakephp code? Some pages of a website can use cakephp and others use non-cakephp code. Can this be done? Thank you. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You recei

Re: Can one use jquery instead of JsHelper?

2013-09-07 Thread Sam
ephp/cakephp/pull/1012 > > So I personally recommend to not rely on it, if you can. > > Sam, if you just started to use CakePHP and have not implemented JSHelper > yet, don't start with it. > There's not much advantage over it except for convenience. > > You sti

Can one use jquery instead of JsHelper?

2013-09-05 Thread Sam
Dear CakePHP experts, I would like to use CakePHP and jQuery. There are sample source code available with jQuery that I would like to use. But when I read CakePHP documentation, the code with JsHelper is different from jQuery. Can I simply use jQuery and not JsHelper in CakePHP? May I ask tho

  1   2   3   4   5   6   7   8   9   >