Re: Use function in controller AND view

2014-12-22 Thread LDSign
Damn, classic not seeing the wood for the trees. Solutions are often so close! Thanks :) Am Dienstag, 23. Dezember 2014 01:12:09 UTC+1 schrieb euromark: > > That's why we refactored the whole thing into a lib class: > > https://github.com/cakephp/cakephp/blob/master/lib/Cake/Utility/CakeNumber.ph

Re: 3.0: Saving new entity with belongsToMany data

2014-12-22 Thread Joe T.
Sorry this took several days to respond, i was sick all weekend, didn't get anywhere near my computer. i changed the names of the inputs from *listingsattrs* >> *listings_attrs* as you recommended (no clue how i missed that to begin with). My POST data now looks exactly as it did before, except

Re: CakePHP 2.0 authentication(login) without ctp files but other types

2014-12-22 Thread tech_me
By the way, I have a table `users` in my db, which have 2 records. id, email, password 1001, abc@com, 123 1002, abc@org, 456 When I input email and password on the login form, it fails at `if ($this->Auth->login())` On Tuesday, December 23, 2014 10:39:39 AM UTC+9, tech_me wrote: > > In my vi

Re: CakePHP 2.0 authentication(login) without ctp files but other types

2014-12-22 Thread tech_me
In my view file(html) In my AppController.php public $components = array('RequestHandler', 'Auth' => array( 'authenticate' => array( 'Form' => array('userModel' => 'User', 'fields'

Re: Use function in controller AND view

2014-12-22 Thread euromark
That's why we refactored the whole thing into a lib class: https://github.com/cakephp/cakephp/blob/master/lib/Cake/Utility/CakeNumber.php App::uses('CakeNumber', 'Utility'); $formattedNumber = CakeNumber::currency($value, $currency); It is documented quite thorougly, by the way: http://book.cakep

Re: How to associate 3 models (or structure a search) to achieve the following structure (Cake 2.x)

2014-12-22 Thread Chris
Hi John thanks for the reply. I'm not sure the purpose of the tables will help with a solution but here goes to be honest your description I think is right. The Customer table stores information about the actual business. e.g. Starbucks. So if my customer is Starbucks, this table will iden

Re: How to associate 3 models (or structure a search) to achieve the following structure (Cake 2.x)

2014-12-22 Thread John Andersen
Please describe your Customer and Contact with more words. What are they in relation to each other? For example: We register information on our customers. For each customer, we have registered the employees that we use as contact when we wish to contact the customer on specific subjects. The c

Use function in controller AND view

2014-12-22 Thread LDSign
Hi Ive a function which converts a number to currency value (e.g. 10 -> 10,00 EUR). So far I have a custom "TextHelper" with that method within (becuase its view related). The problem is, now I need this (exactly same) method in a controller (for generating a flash message). Of course I could

Re: Routing to 2 controllers?

2014-12-22 Thread . .
I think that is the answer I am looking for. I just need to re-arrange my methods then. Thanks for clarifying. On Sun, Dec 21, 2014 at 7:38 PM, Andrew Lechowicz wrote: > Ok. Here's a Gist of what your code might look like: > https://gist.github.com/alecho/e7b573cc54140ba1706d > > By making the m