Re: i didnt understund ajax and jquery
Pedro, I did give you an answer to your last post showing you that there are existing tutorials showing how to do this in CakePHP found within this group or via Google. Because this topic has been covered many times before and there are already guides out there I doubt anyone is going to write you a step by step procedure, what you need to do is try one or more of the tutorials and when you get to a point where you're stuck come in here and show us how far you have got. You will very rarely get an answer in here if you do not show that you have at least tried and the way to do that is to write your own code and copy it into http://bin.cakephp.org/ HTH, Paul On Nov 9, 3:59 am, pedro rojo drupal.chmi...@gmail.com wrote: thank you Justin Edwards for your help I have already programmed a php project with pure javascript and have the same problem two lists that are linked together in php and javascript and ajax, but when I faced the same problem again I 'I could not how. I'm looking for a tutorial that can help me to solve my problem or I share my test someone to organize -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: i didnt understund ajax in cakephp
Duplicate thread: http://groups.google.com/group/cake-php/browse_thread/thread/cd89348af99eab75 http://groups.google.com/group/cake-php/browse_thread/thread/d0ad832f413261e4 On Nov 9, 2:30 am, thom cyber.phanto...@gmail.com wrote: On Wed, Nov 9, 2011 at 8:54 AM, kika drupal.chmi...@gmail.com wrote: Hello everyone! at the beginning I posted my question before but none could give me the answer my problem had the choice lists: I want to make two lists of choices that are related: when I change the option from the first the second will automatically change with ajax in cakephp. so far I have not found a good solution by cons I found a tutorial that explains this by all retailers but nothing will happen I beg you help me because I never used cakephp and ajax or( json) together in a project. thank you again for your attention! You better to do some 'googling' first. Then come here with your code, what you've tried and/ or errors you've got. You asked a frequently asked question and common one. -- Regards,,, thomhttp://mynameisthom.blogspot.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CSS not displaying Form elements correctly
Yves, You're obviously using code when you have no idea what it does ... this is all basic CSS stuff (which is nothing to do with CakePHP by the way) I suggest you get a book or read some online tutorials about CSS to get a good grip on that rather than asking these questions in this group. * {} applies those styles to every single element. What you have there is a very basic attempt to 'reset' (and take control of) the spacing for all elements on a page, search Google for CSS reset and you will find there are some great frameworks for doing this, but you really do need to take the time to learn CSS before you start applying it. It's a much bigger subject than anyone is going to go into detail about in a CakePHP group and there are plenty of available resources elsewhere. HTH, Paul. On Nov 8, 8:00 pm, Yves S. Garret yoursurrogate...@gmail.com wrote: But... the only thing that I did was remove pagination and tried to add a bunch of buttons. Should I include more files? app\ controllers\ providers_controller.php [http://bin.cakephp.org/view/1461038734] models\ provider.php [http://bin.cakephp.org/view/39326804] views\ providers\ view_admit_lookup.ctp [http://bin.cakephp.org/view/848065756] I've also noticed that the start of my CSS file, I have this: * { margin:0; padding:0; } Should I have a * in front of the open bracket? On Tue, Nov 8, 2011 at 2:35 PM, Mike Karthauser mi...@brightstorm.co.ukwrote: On 8 Nov 2011, at 18:16, Yves S. Garret yoursurrogate...@gmail.com wrote: That large button is the original search button created by this: echo $this-Form-submit('Search'); It used to be quite small, green with black text in the middle stating just Search. Looks like your submit button has picked up some styling you've done for your inputs. Look at styling using attribute selectors eg input[type='text'] to select only text input fields. On Tue, Nov 8, 2011 at 1:12 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: See my response re links. You can style the links to look like buttons. What is that huge button across the screen? Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 18:09, Yves S. Garret wrote: I'm going to better illustrate this issue by just posting a pic of what I have. http://i1194.photobucket.com/albums/aa375/ysg444/print_out.png The text-box contains the word Smith in it... buried... On Tue, Nov 8, 2011 at 11:24 AM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Yup - totally agree - was just trying to keep it in context and demonstrate a point to the OP. Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 15:43, Mike Karthauser wrote: On 8 Nov 2011, at 15:28, Jeremy Burns | Class Outfit wrote: Ought to be a class div class=center The css class is: div.center { text-align: center;} (which Is what I guess you are trying to do?) bad form calling a class .center. Classes are supposed to describe the element in some way. what would happen if your .center ended up with massive font and background colour and left aligned? div.center { text-align: left; font-size: 17px; background-color: #CCC; } the .center class name seemed sensible initially but now makes no sense at all. you dont need to add a class to it. you can just use the form element and style that. form { text-align:center; } or form { width: 600px; margin:auto } much less confusing for the next guy who works on your site. Mike Karthäuser Director, Brightstorm Ltd. 1, Brewery Court North Street Bristol BS3 1JS mi...@brightstorm.co.uk s...@brightstorm.co.uk www.brightstorm.co.uk +44(0) 7939252144 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group
Re: Help: how to use cakephp for subdomains
At the risk of Andy slapping me down, this does sound like a rewrite issue that is not allowing /app/webroot to function normally and a request for /css/style.css is looking for a css controller. Do your CSS files load OK in the main domain? You mention sub-domains are not working, but is your main domain? Paul On Nov 8, 6:00 pm, webfacer webfa...@gmail.com wrote: what was the solution On 8 Nov., 11:30, Mamdoohi hamid.mamdo...@gmail.com wrote: thanks AD7 for your answer. cake controllers loads correctly and everythings is ok. my css files exists and when write /app/webroot/css/style.css in address bar, it showing css. but when write /css/style.css .cake send missing controller. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cant apply cakes contain function to this array structure
I would substitute 'pioneer' for 'non-conventional' :) By falling back on the fields array you are only putting off the situation where you need contain fields from models more than 1 level deep. It's great that you can move forward, but I would still recommend getting to grips with contain .. it is very easy (add a behavior and add contain array to your find params - est voila). HTH, Paul. On Nov 8, 5:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: i guess that makes me a pioneer then :) cause none of it worked i abandoned the contain solution here and used the fields param instead. works perfectly. no idea why it came to me sooo damn late thanks for your help guys :) On 8 Nov., 09:32, WebbedIT p...@webbedit.co.uk wrote: @Tomfox: I've not seen people specify conditions and order params in that way before. It should be: $this-Link-find('all', array( 'conditions'=array('Link.created'=$lastLink, 'Link.fk_user_id'= $id), 'order'=array('Link.created DESC'), 'limit'=2, 'contain'=array('Icon') )); Do you have the containable behaviour loaded. What SQL does the above create? @Zuha: I have seen your threads about Containable and CakePHP 2, the first one was a file naming convention issue and the second seems to be solely linked to one plugin (you say yourself it works everywhere else in your app). Plenty of people are using CakePHP 2 without issues involving containable so I suggest there may be something wrong with your plugin setup. HTH, Paul. On Nov 7, 7:19 pm, zuha rich...@razorit.com wrote: I had this problem once and it was because the contain behavior wasn't being called (due to app_model not being named AppModel where I was setting the actsAs containable setting) But I had it happen again, when it was being called and it still didn't work. Contain is pretty buggy now if you ask me. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Multilingual Projects and Jquery
Hi, I have a multilingual project and I am using the P28n and ?php __('text'); ? methods. But I am also doing a lot of Ajax stuff and from time to time I have the need to output text via my javascript files. Is there anyhow a way / a trick ( how to use the cakephp translation () in my js files? Thanks! I look forward to your appreciated answers! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: mod_rewrite in cake
Directory / Options FollowSymLinks AllowOverride ALL /Directory Directory / Options FollowSymLinks AllowOverride All /Directory You have used ALL instead of All Regards sathia http://lquery.com/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: how can i check the session´s Auth for show html (login logout)
@Ogalov: The correct way to check if a user is logged in within the view is: $session-check('Auth.User.id'); The point is you are not wanting to read a value as you are not then using the value, you simply want to check if it exists and perform some other logic. Jeremy gave you this answer and you decided to modify your own solution (to something less flawed, but still flawed) rather than use what he provided. So my reply of Jeremy. thank for you answer.. (but I am going to ignore it) Was FACT (with a hint of sarcasm), as I have seen a lot of people not taking Jeremy's (and other's) advice of late. It's great that you're learning CakePHP and we welcome you to the group wholeheartedly, but when you ask for help and it is given try using it. It may not always work as those offering help can make mistakes or misunderstand the question, but to ignore their answer and continue to do your own thing is only going to increase the chances of that person not helping you in the future. HTH, Paul. On Nov 8, 11:50 am, Ogalav omar...@gmail.com wrote: Jeremy, sorry but the Session-check no found it in the 'if else', i mean i use for read the user active that is all. i dont now why you say rash of peaple doing it wrong??? or what said webbedit !!! have i take it as sarcasm???.. I'm reading a lot of cake and I'm no expert .. but I'm getting better every day. thank you very much for your answers regards WebbeDIT what mean... (but I am going to ignore it) On 8 nov, 09:48, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Lately there seems to be a rash of people doing it wrong, ignoring good advice and then continuing to have problems (aka Cake is buggy/rubbish). Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 08:39, WebbedIT wrote: Jeremy. thank for you answer.. (but I am going to ignore it) You've got to laugh, Paul -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Ho to register a newsletter link and redirect to a popup?
redirect to: array('controller'='pages', 'action'='home', 1) or array('controller'='pages', 'action'='home', 'popupQuestionnaire'=1) Or save a value to the session. Using any of the above will allow you to check for a value within your home page view and run some javascript. HTH, Paul. On Nov 8, 10:49 am, heohni heidi.anselstet...@consultingteam.de wrote: Hi, I would like to send a newsletter with a link like domain.com/n/ 12345 I added a route like Router::connect('/n/*', array('controller' = 'newsletter', 'action' = 'index')); where I count the click. Now I want to redirect the user to the homepage together with a new parameter passed, as I need to identify the redirection via jquery in order to open a popup with some survey questions. And this is the point where I struggle... How can I create a redirect to the homepage from my newsletter controller, including a url parameter which I can catch via jquery? Please help!! I am lost! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Need a little help with HABTM joins
So by default you are associating all Articles to Pieces? I really suspect you're going about things in the wrong way here. Paul. On Nov 8, 10:04 am, Ernesto e.fanz...@gmail.com wrote: Thanks for the effort, i solved this way: - in both articles/add and pieces/add users can enter just code and description, no related model data - after a successfull add() both Article and Piece models add every possible combination between them and the other model. The app then redirects diretcly to the edit action - in both edit actions there's a simple hasMany form where the users can modify the ArticlePieces data. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Need a little help with HABTM joins
What happens if when the edit form first shows you unassociate all pieces, what happens the next time you load the edit form? I suspect the way you've done it you will get no pieces again. As mentioned earlier you should be using: $this-Article-Piece-find('all'); or $this-Article-Piece- find('list'); if populating an array to then be used as options in a form. HTH, Paul On Nov 9, 9:11 am, WebbedIT p...@webbedit.co.uk wrote: So by default you are associating all Articles to Pieces? I really suspect you're going about things in the wrong way here. Paul. On Nov 8, 10:04 am, Ernesto e.fanz...@gmail.com wrote: Thanks for the effort, i solved this way: - in both articles/add and pieces/add users can enter just code and description, no related model data - after a successfull add() both Article and Piece models add every possible combination between them and the other model. The app then redirects diretcly to the edit action - in both edit actions there's a simple hasMany form where the users can modify the ArticlePieces data. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Get controllers name and action to javascript without passing as variable in cake PHP
$this-params is available in the view too, simply echo the values into your javascript within the view: var controller = ?php echo $this-params['controller']; ?; var action = ?php echo $this-params['action']; ?; HTH, Paul. On Nov 8, 8:51 am, jusnit jusnit1...@gmail.com wrote: Is it possible to get controllers name and action to javascript without passing as variable in cake PHP Like in cake controllers : $this-params will get for controllers name etc.. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cant use css() method for my subdomain
ROFL On Nov 8, 9:45 am, AD7six andydawso...@gmail.com wrote: On Nov 8, 6:55 am, Mamdoohi hamid.mamdo...@gmail.com wrote: the css() method from html class work not correctly and when I use this method for my subdomain it cant load css file correctly Have a talk to this guy:http://groups.google.com/group/cake-php/browse_thread/thread/570451b0... AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Cannot login in cake 2.0 app
Ernesto, What was your typo? I am having trouble with logging in as well. On Oct 12, 5:28 am, Ernesto e.fanz...@gmail.com wrote: nvm. found the typo, now it's all working ok -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Trying to get REST working Properly in Cake 2.0
Matt, xml-serialize looks cakephp 1.3, http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html?highlight=rss You could also just do a foreach on the array to manually output at the view… Andras Kende On Nov 8, 2011, at 11:27 PM, Matthew Kaufman wrote: Hello, Setting up REST is always frustrating for me at first honestly in Cake. I prefer to interact with my applications to add data via Curl on the command line; Let's start out at Step 1 Though: /app/Config/routes.php: Router::mapResources('training_categories'); Router::mapResources('central_index_keys'); Router::mapResources('standard_industrial_classification_codes'); Router::parseExtensions('json', 'xml'); /app/Controllers/StandardIndustrialClassificationCodesController.php class StandardIndustrialClassificationCodesController extends AppController { var $components = array('RequestHandler'); /** * index method * * @return void */ public function index() { $this-StandardIndustrialClassificationCode-recursive = 0; $this-set('standardIndustrialClassificationCodes', $this-paginate()); $this-set('standard_industrial_classification_codes', $this-paginate()); //$standard_industrial_classification_codes = $this-StandardIndustrialClassificationCode-find('all'); //$this-set(compact('standard_industrial_classification_codes')); } root@mkfmnweb:/var/www/cake_2_0/app/View# cat StandardIndustrialClassificationCodes/xml/index.ctp ?php // app/views/standard_industrial_classification_codes/xml/index.ctp ? standard_industrial_classification_codes ?php $xml-serialize($standard_industrial_classification_codes); ? /standard_industrial_classification_codes root@mkfmnweb:/var/www/cake_2_0/app/View# Anyway, when I try to access http://192.168.1.100/cake_2_0/standard_industrial_classification_codes.xml it should render properly; but now it tells me that I have an undefined variable; or Call to a member function serialize() on a non-object in my StandardIndustrialClassificationCodes/xml/index.ctp on line 6 Attatching a screenshot to this message. How can I setup basic REST? Another thing I would like to know is how can I best lay out in the controller to support basic Browser based form INSERT's (Controller/StandardIndustrialClassificationCodeController.php add()) with the scaffold generated HTML form view as well as doing a curl -X POST to http://server/cake_2_0/standard_industrial_classification_codes/add.xml with the data inputted from their sent in with XML headers on it? That is my secondary question. First question is how can I get the new Cake to list me out my nice XML? :). Thanks, Matt Kaufman -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php cake-rest-problem.jpg -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Get controllers name and action to javascript without passing as variable in cake PHP
On Nov 9, 10:17 am, WebbedIT p...@webbedit.co.uk wrote: $this-params is available in the view too, simply echo the values into your javascript within the view: var controller = ?php echo $this-params['controller']; ?; var action = ?php echo $this-params['action']; ?; personally I use body id=?php echo $this-name = class=?php echo $this-action allows css or js to know where you are. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Help: how to use cakephp for subdomains
On Nov 9, 9:18 am, WebbedIT p...@webbedit.co.uk wrote: At the risk of Andy slapping me down, this does sound like a rewrite issue that is not allowing /app/webroot to function normally and a request for /css/style.css is looking for a css controller. New information - new answer :) AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Help: how to use cakephp for subdomains
On Nov 9, 11:48 am, AD7six andydawso...@gmail.com wrote: On Nov 9, 9:18 am, WebbedIT p...@webbedit.co.uk wrote: At the risk of Andy slapping me down, this does sound like a rewrite issue that is not allowing /app/webroot to function normally and a request for /css/style.css is looking for a css controller. New information - new answer :) AD Oops forgot this bit: check your 3 .htaccess files -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Need a little help with HABTM joins
nothing happens. users cannot de-associate Articles and Pieces -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
extracting Model and Field from a Set compatible path
Hi all i have an array containing a series of set compatible paths array( [0] = Article.code, [1] = {n}.Piece.code, [2] = Note.{n}.text ) is there any built-in function that extracts the Model and the field those paths are referencing? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: extracting Model and Field from a Set compatible path
Have you looked at Set::extract? Jeremy Burns Class Outfit http://www.classoutfit.com On 9 Nov 2011, at 10:59, Ernesto wrote: Hi all i have an array containing a series of set compatible paths array( [0] = Article.code, [1] = {n}.Piece.code, [2] = Note.{n}.text ) is there any built-in function that extracts the Model and the field those paths are referencing? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: extracting Model and Field from a Set compatible path
hi jeremy. thanks for the response. Set::extract extracts data from an arary. i wan to extract Model and field from the Path itself -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Problem Auth Component | CakePHP 2.0.2
hi all, its work; i changed the form fields to username and password. could it be possible that may not use usr and pwd? public $components = array( 'Auth'= array( 'authenticate' = array( 'Form' = array( 'fields' = array('username' = 'User.username', 'password' = 'User.password') ) ) ) ); Von: Serkan Sipahi serkan.sip...@yahoo.de An: cake-php@googlegroups.com cake-php@googlegroups.com Gesendet: 13:47 Mittwoch, 9.November 2011 Betreff: Re: Problem Auth Component | CakePHP 2.0.2 hi, that has not helped me(What if you try $this-Auth-login -- small 'l' in login?) ;( i dont know what i do wrong!! Debug is 2 and that give me no error! Von: Davor Ilic webfa...@gmail.com An: cake-php@googlegroups.com Gesendet: 18:35 Dienstag, 8.November 2011 Betreff: Re: Problem Auth Component | CakePHP 2.0.2 does this helped you Serkan? 2011/11/7 Jeremy Burns | Class Outfit jeremybu...@classoutfit.com What if you try $this-Auth-login -- small 'l' in login? Jeremy BurnsClass Outfit http://www.classoutfit.com On 7 Nov 2011, at 18:55, Serkan Sipahi wrote: hi again, the password is hashed in the database and it still does not work! please help me cake community Von: Serkan Sipahi serkan.sip...@yahoo.de An: cake-php@googlegroups.com cake-php@googlegroups.com Gesendet: 15:08 Sonntag, 6.November 2011 Betreff: Re: Problem Auth Component | CakePHP 2.0.2 hi, wft! why is this so difficult? I'm not stupid!! Von: Serkan Sipahi serkan.sip...@yahoo.de An: cake-php@googlegroups.com cake-php@googlegroups.com Gesendet: 18:09 Samstag, 5.November 2011 Betreff: Re: Problem Auth Component | CakePHP 2.0.2 hi, thank you for your note. But it still doesnt work. 'fields' = array('username' = 'usr', 'password' = 'pwd') ...doesnt work as well !!! 'fields' = array('username' = 'User.usr', 'password' = 'User.pwd') ...doesnt work as well !!! Controller: class PricerobotStoreEnginesController extends AppController { public $components = array( 'Auth'= array( 'authenticate' = array( 'Form' = array( 'fields' = array('username' = 'usr', 'password' = 'pwd') //'fields' = array('username' = 'User.usr', 'password' = 'User.pwd') ...doesnt work as well !!! ) ) ) ); } class UsersController extends AppController { public $components = array('Auth','Security'); public function login() { if ($this-request-is('post')) { if ($this-Auth-Login()) { $this-redirect(array('controller' = 'PricerobotStoreEngines', 'action' = 'index')); } else { $this-Session-setFlash(__('Username or password is incorrect')); $this-redirect(array('controller' = 'users', 'action' = 'login')); } } } public function logout() { $this-redirect($this-Auth-logout()); } } View: echo $this-Form-create(); echo $this-Form-input('usr'); //text echo $this-Form-password('pwd'); //password echo $this-Form-end('Login'); Database: Table: users fields: usr, pwd Von: Ryan Schmidt google-2...@ryandesign.com An: cake-php@googlegroups.com Gesendet: 12:40 Samstag, 5.November 2011 Betreff: Re: Problem Auth Component | CakePHP 2.0.2 On Nov 5, 2011, at 03:46, Serkan Sipahi wrote: I really need help. What is my cake mistake? I assume you need to do what it says in the documentation, and inform CakePHP that your username is stored in the field usr and the password is in the field pwd; see the part under To configure different fields for user in $components array: http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#configuring-authentication-handlers -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video
Themed assets not loading on production server
I'm using the Theme viewClass and loading assets through a Themed folder and everything is working well on my local development server, but when taking it online nothing is being loaded from the Themed folder and it's getting a 404 when trying the default locations. Here's the folder structure: View -Themed --default ---webroot css -admin.css and it's not finding admin.css here so it looks for webrootcssadmin.css which doesn't exist. Anyone have any suggestions as to how to debug? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: extracting Model and Field from a Set compatible path
On Nov 9, 1:43 pm, Ernesto e.fanz...@gmail.com wrote: hi jeremy. thanks for the response. Set::extract extracts data from an arary. i wan to extract Model and field from the Path itself you mean extract a string and another string from a string? sounds like you need: preg_match AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Are automagic models for HABTM not supported anymore in 2.0?
After upgrading a larger project to 2.0 i got hundreds of errors that need manual corrections. But some bug me more than others. If you have User and Hotel models and you got HABTM between them you sometimes want to use the join table to in order to get better queries (left join etc). In 1.3 this worked: //Hotel.php $this-bindModel(array('hasOne' = array('HotelUser')), false); Afaik it uses AppModel instance and the HABTM information to set up this model. In 2.0 this fatal errors because it App::loads the Hotel again. Actually - after some debugging - it tries to load hotel.php (note the lowercase!) which of course on windows will load Hotel.php. Result: A double include and PHP dies with cannot redeclare class After quite some time I got it fixed by creating a dummy file named HotelUser.php containing: App::uses('AppModel', 'Model'); class HotelUser extends AppModel {} But this might blow up at many other locations as well. Not sure if this is now not supported anymore or a real bug. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Console/cake schema not working a 100%?
Hi guys, I'm on cake 2.0.2 and using the Console to backup my schema. But I thing its not working a 100%. 1. When I try to use 'Console/cake schema create' I get an error message saying: 'schema.php could not be loaded' 2. The generated files (by 'generate' and 'dump') do not contain the table 'cake_sessions'. Am I doing sth wrong or is this a bug in the console?? -flosky -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Trying to re-use a method in the controller by different inputs/buttons in the view
Thanks, Jeremy, I got it working just the way that I wanted with your help. On Tue, Nov 8, 2011 at 1:11 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: What we are trying to show you is that you don't need to go to the overhead of using loads of forms; simple links will work. They also have the advantage that you can distribute the link. echo $this-Html-link( 'A', array( 'controller' = 'widgets', 'action' = 'filter', 'a' ) ); echo $this-Html-link( 'B', array( 'controller' = 'widgets', 'action' = 'filter', 'b' ), array( 'class' = 'selected' // because the user clicked 'B' ) ); Jeremy Burns Class Outfit http://www.classoutfit.com echo $this-Html-link( 'C', array( 'controller' = 'widgets', 'action' = 'filter', 'c' ) ); Could render these with a for/next loop of course. In your filter action, $letter = 'b'. $widgets is set to the returned find (where Widgets.name starts with 'b'). One change I should make is to convert the first letter of the name to lower case, so something like this: function filter($letter) { $widgets = $this-Widget-find( 'all', array( 'conditions' = array( strtolower(substr('Widget.name', 0, 1)) = $letter ) ) ); $this-set(compact('letter', 'widgets')); } Jeremy Burns Class Outfit Tel: +44 (0) 208 123 3822 Mob: +44 (0) 7973 481949 Skype: jeremy_burns http://www.classoutfit.com On 8 Nov 2011, at 17:48, Yves S. Garret wrote: I'm not following. $letters has just the names of the buttons and their identification (can't really word this any better, basically the idea is that once I click on a link/button, the identity of that button gets passed to the controller and it does something specific for it). It would seem $widgets and $letter are the same... then why not just use $letter? On Tue, Nov 8, 2011 at 11:31 AM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Have a controller action, something like: function filter($letter) { $widgets = $this-Widget-find( 'all', array( 'conditions' = array( substr('Widget.name', 0, 1) = $letter ) ) ); $this-set(compact('letter', 'widgets')); } Then $widgets is a variable in your view that contains only those whose name starts with $letter. You can use the $letter variable to highlight the href for that letter. There are better ways of doing this (you could store the first letter of 'Widget.name' in a table field and search on that and you could use a model function too. But this concept would work. Jeremy Burns Class Outfit http://www.classoutfit.com On 8 Nov 2011, at 16:12, Yves S. Garret wrote: What do you mean? a href? On Tue, Nov 8, 2011 at 11:09 AM, Benni Graf bennig...@gmail.com wrote: Hi there, Before someone tells you how to do what you want, let me ask you: Why don't you use a simple link instead of a form-button? That would make less markup and more sense to me. And with a certain amount of css you could easily make the link look like a button just to please your executives ;-)... Regards, Benni. On 8 Nov., 16:54, Yves S. Garret yoursurrogate...@gmail.com wrote: Before I even go on, here is what I have: View:http://bin.cakephp.org/view/404159005 Controller:http://bin.cakephp.org/view/21698870 The idea that I'm trying to do is have a row of buttons spanning the alphabet. The user clicks on the button and then it lists all of the people with their last name starting with the specific letter. This is a requirement, yes, I know, you can just type in 'R' and hit Enter and the same thing will be done, no, this did not please powers-that-be. Moving on... I didn't want to create a function for _every_ button. That seemed painful and just bad coding. I would like to call that method and then pass in a value (in this case, a string of one length) and the method will perform a specific function based on the input. I tried this line of code: echo $this-Form-button($letter, array('action' = 'view_admit_lookup')); I did some digging online: http://book.cakephp.org/view/1415/buttonhttp://api.cakephp.org/file/cake/libs/view/helpers/form.php#method-Fo. .. I couldn't find anything that would do this for me easily. Am I missing something? Did I look into the wrong docs? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For
Re: Multilingual Projects and Jquery
No there isn't really. This is also a problem for any language, and unless you have back-end parsed JS files it's not possible. The only solution is so place a JS literal object in your page source containing the message strings: script var Msg = { username: '?php echo __('username'); ?', someKey: '?php echo __('moreKeys'); ?' }; /script And then reference it in your JS: alert(Msg.username); On Nov 9, 12:26 am, heohni heidi.anselstet...@consultingteam.de wrote: Hi, I have a multilingual project and I am using the P28n and ?php __('text'); ? methods. But I am also doing a lot of Ajax stuff and from time to time I have the need to output text via my javascript files. Is there anyhow a way / a trick ( how to use the cakephp translation () in my js files? Thanks! I look forward to your appreciated answers! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Cannot log in using CakePHP 2.0
Not sure if this will work, but remember to add this to your AppController file, since your password field is not password but key. var $components = array('Session', 'Auth'= array( 'authenticate' = array( 'Form' = array( 'fields' = array('username' = 'email', 'password' = 'key') ) ) ) ); Also make sure your database field is large enough to fit the whole password. SHA1 hashes are 20 bytes long. On Nov 7, 8:38 pm, Keyner key...@peru.com wrote: I followed what you did but I can not work. I have 2 fields for authentication emailkey How do I resolve this? I did this at the controller public function ingresar() { $this-set('usersss',AuthComponent::password($this-data['User'] ['key'])); if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else { $this-Session-setFlash(__('Invalid username or password, try again')); } } and the view throws me the following c984aed014aec7623a54f0591da07a85fd4b762d1 however, in the model public function beforeSave () {if (isset ($ this-data [$ this-name] ['key'])) {$this-data ['User']['key'] = AuthComponent::password(data ['User'] ['key']);}return true;} and the data recorded c984aed014aec7623a54f0591da07a85fd4b762d without the 1 at the end. What do I do? On 7 nov, 20:40, Sandy Wilkins sandy.wilkins...@gmail.com wrote: Ok, got it to work! I guess its a combination of all these suggestions, but it finally didloginwhen I commented the following: $this-Auth-userModel = 'Users'; // $this-Auth-fields = array('username' = 'email', 'password' = 'password'); -- commented out $this-Auth-loginAction = array('controller' = 'users', 'action' = 'login'); $this-Auth-loginRedirect = array('controller' = 'hotels', 'action' = 'dashboard'); $this-Auth-logoutRedirect = array('controller' = 'users', 'action' = 'login'); I added this to my code, as I explained before: var $components = array('Session', 'Auth'= array( 'authenticate' = array( 'Form' = array( 'fields' = array('username' = 'email') ) ) ) ); Thanks John and Andras for your help! Really appreciated! On Nov 7, 7:29 pm, Sandy Wilkins sandy.wilkins...@gmail.com wrote: I commented out all the code in theloginmethod, and when I submit the form I see no sql queries in the bottom of the layout. I'm just sent back to the sameloginform, no info below. On Nov 6, 9:52 am, Andras Kende and...@kende.com wrote: The code looks good, You could comment out the $this-redirect($this-Auth-redirect()); fromloginmethod and check the sql dump to see if the mysql query is correct … Andras Kende On Nov 5, 2011, at 9:01 PM, Sandy Wilkins wrote: I'm trying to get a simpleloginform to work using CakePHP 2.0... just Auth, no ACLs for now. I'm able to see the form and enter the email and password as they are in the database, but I just get returned to the form and the flash error message is displayed. Here is my code: **AppController:** class AppController extends Controller { function beforeFilter() { $this-Auth-userModel = 'Users'; $this-Auth-fields = array('username' = 'email', 'password' = 'password'); //have to put both, even if we're just changing one $this-Auth-loginAction = array('controller' = 'users', 'action' = 'login'); $this-Auth-loginRedirect = array('controller' = 'hotels', 'action' = 'dashboard'); $this-Auth-logoutRedirect = array('controller' = 'users', 'action' = 'login'); } } **login.ctp:** ?php echo $this-Form-create(); //'User', array('action' = 'login')); echo $this-Form-input('email'); echo $this-Form-input('password'); echo $this-Form-end('Login'); ? **UsersController:** ?php class UsersController extends AppController { var $name = 'Users'; var $helpers = array('Html','Form'); var $components = array('Auth','Session'); function beforeFilter() { $this-Auth-allow(logout); parent::beforeFilter(); } function index() { } //Redirects tologin() functionlogin() { if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else {
bigint datatype in Fixtures
Hi, I've been spending a few hours trying to work out why my unit-tests don't work, while if I run the same code on the website with the same data works fine. Well, here's the story: - I've got 2 columns of type 'bigint' in one of my database tables, on which I do comparison based lookups. Therefore they cannot be varchars. They can't be ints, because they're too big and if I were to turn them to ints, half of my data gets truncated. - They work quite fine with my models and a find method like this fetches the right results: $data = $this - find('first' , array('conditions' = array('number1 =' = $number , 'number2 =' = $number))) ; - The problem arises when I'm testing using fixtures. Bake will setup both of the two numbers as type 'integer' in the fields declaration. Using $import in the fixture will have similar results. public $fields = array( 'id' = array('type' = 'integer', 'null' = false, 'default' = NULL, 'key' = 'primary', 'collate' = NULL, 'comment' = ''), 'number1' = array('type' = 'integer', 'null' = false, 'default' = NULL, 'collate' = NULL, 'comment' = ''), 'number2' = array('type' = 'integer', 'null' = false, 'default' = NULL, 'collate' = NULL, 'comment' = ''), ... truncated ... ); Now when I run my tests, the exact same find query, fetches only records which fall within the boundary of int(11). Playing around I ended up changing the Fixture definition to define the two numbers as strings : public $fields = array( 'id' = array('type' = 'integer', 'null' = false, 'default' = NULL, 'key' = 'primary', 'collate' = NULL, 'comment' = ''), 'number1' = array('type' = 'string', 'null' = false, 'default' = NULL, 'collate' = NULL, 'comment' = ''), 'number2' = array('type' = 'string', 'null' = false, 'default' = NULL, 'collate' = NULL, 'comment' = ''), ... truncated ... ); and suddenly everything is honky dory. My questions are : 1) why do I get an inconsistent behaviours between my application and my tests ? 2) my current solution to get the tests working is bodge. What's the best way to get this working across the app? Cheers, Shuku -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Are automagic models for HABTM not supported anymore in 2.0?
Euromark, This sounds similar to http://cakephp.lighthouseapp.com/projects/42648/tickets/2223-custom-modelclassname-in-inputs-leads-to-appload-trying-to-load-the-class Been trying to resolve this too. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Are automagic models for HABTM not supported anymore in 2.0?
yes, it sure does. only that in your case its part of the form (view) and in my case part of the query building (model). but sth with App::load anyway On 10 Nov., 01:04, rchavik rcha...@gmail.com wrote: Euromark, This sounds similar tohttp://cakephp.lighthouseapp.com/projects/42648/tickets/2223-custom-m... Been trying to resolve this too. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: bigint datatype in Fixtures
I had similar problem with 'double' type and CakeSchema (therefore with CDC plugin migrations as well) - DboSource maps it as float. Straightforward solution (not DBO-independent, though) was raw sql ALTER TABLE ... MODIFY COLUMN ... statement in after() callback. Take it just as possible direction, I'm not sure if it is possible to change descendant of CakeTestFixture to run raw sql after table is created and before test data are inserted. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
[with CakePHP *2*]... How Can I Controller::add() content into Cake via Curl on Command Line?
Hello, Before with Cake 1.3 it was very easy to add content into Cake via command line using curl and HTTP POST: I'd setup as such: */app/Config/routes.php* Router::mapResources('central_index_keys'); Router::parseExtensions('xml'); And obviously have* my controller: *public $components = array('RequestHandler', 'Session'); I also tried using the Security component; but it kept getting black-holed; when I would run this command: * curl -XPUT -d 'central_index_keyid/idcik9/cikcompany_namestr/company_name/central_index_key' http://192.168.1.100/cakephp/central_index_keys.xml --header 'content-type:text/xml' * or * curl -XPOST -d 'central_index_keyid/idcik9/cikcompany_namestr/company_name/central_index_key' http://192.168.1.100/cakephp/central_index_keys.xml --header 'content-type:text/xml'* I basically want to be able to; instead of using the Form view in the browser at http://192.168.1.100/cakephp/central_index_keys/add --- be able to use Curl on the command line to insert the data in. How can I achieve this with *Cake 2.0.2?* -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: [with CakePHP *2*]... How Can I Controller::add() content into Cake via Curl on Command Line?
Hello everyone, This is what works: root@mkfmnweb:/home/matt# curl -XPOST -d 'CentralIndexKeyid/idcik2002/cikcompany_nameCAKEPHP/company_name/CentralIndexKey' http://192.168.1.100/cakephp/central_index_keys/add.xml --header 'content-type:text/xml' The changes I notice from the 1.3 branches of Cake's RequestHandler / REST setups are: 1) the URL must point to /add.xml --- not controller.xml (eg central_index_keys.xml). 2) the parent of the XML tree must be in the new camel case style: eg: CentralIndexKey Not central_index_key. In summary; this *makes more sense *and Yay!! Thanks. Matt Kaufman http://mkfmn.com/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php