W3C validator doesn't like FormHelper's hidden field
Hi all hidden fields genetared with FormHelper are failing my validation. that's because they arent' wrapped in a DIV. is that intended? -- 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
datetime difference in days(created and action_date column)
Dear friends I would like to ask how to implement calculation at view.ctp and controllers to get difference between created and action date column and to be appear at duration column. i found resource in php but i dont know how to implement it into cakephp hope can help me thank you in advance -- 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
Error Migrations
Hi guys! I'm try to generate a schema.php with command $ Console/cake schema generate but i got a error: Error: Database connection Postgres is missing, or could not be created. #0 /Library/WebServer/Documents/fomento/lib/Cake/Model/ ConnectionManager.php(101): DboSource-__construct(Array) #1 /Library/WebServer/Documents/fomento/lib/Cake/Model/ CakeSchema.php(203): ConnectionManager::getDataSource('default') #2 /Library/WebServer/Documents/fomento/lib/Cake/Console/Command/ SchemaShell.php(160): CakeSchema-read(Array) #3 /Library/WebServer/Documents/fomento/lib/Cake/Console/ Shell.php(386): SchemaShell-generate() #4 /Library/WebServer/Documents/fomento/lib/Cake/Console/ ShellDispatcher.php(177): Shell-runCommand('generate', Array) #5 /Library/WebServer/Documents/fomento/lib/Cake/Console/ ShellDispatcher.php(69): ShellDispatcher-dispatch() #6 /Library/WebServer/Documents/fomento/app/Console/cake.php(41): ShellDispatcher::run(Array) #7 {main} My $default connection databse.php is working when start my application. -- 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: datetime difference in days(created and action_date column)
On Jan 12, 8:18 am, aku Gaban akugaba...@gmail.com wrote: Dear friends I would like to ask how to implement calculation at view.ctp and controllers to get difference between created and action date column and to be appear at duration column. i found resource in php Is it a secret hidden resource only for the eyes of the elite? There are lots of ways to do that - the simplest of which is to do it exactly the same way you'd do it with php since (gasp) CakePHP is written in php. 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: datetime difference in days(created and action_date column)
thank you ad for your reply. ?php echo round(abs((strtotime($aduan['complain']['created'])- (strtotime($aduan['complain']['action_date']))/86400))); ? but this seem not appear what i want. i have no idea.not good in php too On Jan 12, 5:29 pm, AD7six andydawso...@gmail.com wrote: On Jan 12, 8:18 am, aku Gaban akugaba...@gmail.com wrote: Dear friends I would like to ask how to implement calculation at view.ctp and controllers to get difference between created and action date column and to be appear at duration column. i found resource in php Is it a secret hidden resource only for the eyes of the elite? There are lots of ways to do that - the simplest of which is to do it exactly the same way you'd do it with php since (gasp) CakePHP is written in php. 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: Can not change default Model and fields :(
Hi AD, Thanks for your reply I'm not overwriting the array/configuration,I found the problem in core file (I think its a bug and need to fix it). It is in /lib/Cake/Controller/Component/Auth/FormAuthenticate.php on line 61,62 and 67,68 Thanks Vaibhav number 61,61 and 67,68 On Jan 9, 2:04 pm, AD7six andydawso...@gmail.com wrote: On Jan 9, 9:53 am, vaibhav.malushte vaibhav.malus...@gmail.com wrote: Hi, After spending 2 days, finally I've found why it was not working. In /lib/Cake/Controller/Component/Auth/FormAuthenticate.php on line number 61,61 and 67,68 it is trying to access the undifined $fields['username'] and $fields['password'] index it should be only ['username'] and ['password']. Those keys are always set (See BaseAuthenticate settings property) - That means you've somehow managed to configure the auth component to effectively unset them. Just replace empty($request-data[$model][$fields['username']]) || empty($request-data[$model][$fields['password']]) With empty($request-data[$model][['username']) || empty($request-data[$model]['password']) and you are done You mean edit the core files? Don't. Do. That. Either it's a bug and it needs fixing, or there's an error in your code. Given there are tests covering this core component's usage, it's quite likely the latter. It's hard to read your code; but if you were able to find the error - I trust you're also able to find where you're overwriting the settings array to remove the keys the code relies upon to work. 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: Can not change default Model and fields :(
On Jan 12, 11:25 am, vaibhav.malushte vaibhav.malus...@gmail.com wrote: Hi AD, Thanks for your reply I'm not overwriting the array/configuration The point of my post was that you, directly or indirectly, are. Look at the settings array in base authenticate which form authenticate inherits from. ,I found the problem in core file (I think its a bug and need to fix it). It is in /lib/Cake/Controller/Component/Auth/FormAuthenticate.php on line 61,62 and 67,68 I don't know what bug you see there - the code assumes that both: $this-settings['fields]['username'] $this-settings['fields]['password'] are set. Which is logical since those settings are _required_ and set by default. In any event you can submit a pull request with any changes you think are required to fix 'the bug' - but if your changes are simply changing configuration for hardcoded values they won't be accepted. 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: Auth Component problem
I have followed this tutorial and now it's working! Thank you. On 11 jan, 14:14, Tilen Majerle tilen.maje...@gmail.com wrote: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-examp... check this it was some changes created :) -- Lep pozdrav, Tilen Majerlehttp://majerle.eu 2012/1/11 Glauco Custódio glauco.custo...@gmail.com Hi there, I am migrating my base app from 1.3x to 2.0.5. I have copied a lot of my code and I am changing where is necessary... Auth component is configured, but it is allowing any username/password to log in and message of invalid username is not appearing. Link to my code:http://bin.cakephp.org/view/416619310 Please help me, thank you. -- 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 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
Installation problem with newly baked app
I just installed Cake 2 on windows 7 running WAMP server, in folder C: \wamp\www\cake. I baked a new app that is in folder C:\wamp\www \swr_app and set up my default database connection. But when I browse in localhost/swr_app I get the following error: ( ! ) Warning: include(Cake\bootstrap.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\swr_app \webroot\index.php on line 79 Call Stack # TimeMemory FunctionLocation 1 0.0017 387168 {main}( ) ..\index.php:0 ( ! ) Warning: include() [function.include]: Failed opening 'Cake \bootstrap.php' for inclusion (include_path='C:\wamp\www\lib;.;C:\php \pear') in C:\wamp\www\swr_app\webroot\index.php on line 79 Call Stack # TimeMemory FunctionLocation 1 0.0017 387168 {main}( ) ..\index.php:0 ( ! ) Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your \cake core directory and your \vendors root directory. in C:\wamp\www\swr_app\webroot\index.php on line 88 Call Stack # TimeMemory FunctionLocation 1 0.0017 387168 {main}( ) ..\index.php:0 2 0.0035 388032 trigger_error ( ) ..\index.php:88 I have not edited any of these files. Thanks. -- 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: datetime difference in days(created and action_date column)
You could try googling for it. http://lmgtfy.com/?q=date+difference+php Also, in the future, let's try and keep this group CakePHP related. While I don't mind helping out with PHP-only questions here and there, that's not really the purpose of this group :) Anyway, try date_diff. Like AD said, there's many ways to do this. That's one. -- 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
minor upgrading
I inherited a CakePHP 1.3.8 application How does one do an upgrade to the latest 1.3.14 without overwriting/wiping scripts and config settings. The 'Cookbook' on cakephp.org / Learn only gives upgrade information about major upgrades ('migrations') -- 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: minor upgrading
hi nico On 12 Jan 2012, at 13:53, Nico DeHerdt wrote: I inherited a CakePHP 1.3.8 application How does one do an upgrade to the latest 1.3.14 without overwriting/wiping scripts and config settings. The 'Cookbook' on cakephp.org / Learn only gives upgrade information about major upgrades ('migrations') i suspect you'll not need to do anything to your app apart from upgrading the cake directory and changing the appropriate path in webroot/index.php be sure to clear back your cache files as well. mikek Mike Karthäuser Director, Brightstorm Ltd. 1, Brewery Court North Street Bristol BS3 1JS mi...@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 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: minor upgrading
Backup Just replace your cake folder with the one from 1.3.14 version. Leave the app folder as is. Andras Kende On Jan 12, 2012, at 7:53 AM, Nico DeHerdt wrote: I inherited a CakePHP 1.3.8 application How does one do an upgrade to the latest 1.3.14 without overwriting/wiping scripts and config settings. The 'Cookbook' on cakephp.org / Learn only gives upgrade information about major upgrades ('migrations') -- 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: datetime difference in days(created and action_date column)
convert to unix timestamp using TimeHelper::fromString() , substract, and you'll get duration in miliseconds.. erm.. ever heard of this question before.. On Jan 12, 3:18 pm, aku Gaban akugaba...@gmail.com wrote: Dear friends I would like to ask how to implement calculation at view.ctp and controllers to get difference between created and action date column and to be appear at duration column. i found resource in php but i dont know how to implement it into cakephp hope can help me thank you in advance -- 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: Is it possible to turn off transactions in saveAll() ?
Hahaha... I can't believe I've made stupid mistake like that. Yes, I typed 'false' as a string. Now this script is able to rollback() :D But new problems arise :( If the 'atomic' set to false, how I know when saveAll() fails? Because when I put saveAll() in IF statement like this: if(!$this-BranchRequest-saveAll($this- data,array('validate'='first','atomic'=false))) It seems not working. -- 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: Error Migrations
add to app/Config/bootstrap.php phpinfo(1); then run in console: cake Look for 'Loaded Configuration File' and location of loaded php.ini (when running PHP as CLI). Check if PDO is loaded... -- 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 to EDIT default layout in CakePHP 2.0.5?
yep, seems obvious in hindsight... I was following the the blog tutorial but it seems to assume prior knowledge of the last version of Cake... On Jan 11, 5:14 pm, AD7six andydawso...@gmail.com wrote: out of curiosity - did the idea to simply look for the file default.ctp in your project not arise? 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
Add a record to an extra table which belongsto the actual table.
I have a form to input all the items of a coin. There is - besides others - also an attribute Nominal to enter. Nominals are kept in an extra table which is joined to coins with a belongsto. The existing items can be selected in a drop-down - everything's fine! But what, if there es a new nominal which has to be inserted into nominals and into coins. I would like to have a textfield to enter the nominal - and a function which inserts the new nominal into the table nominals and the reference to it into the table coins. Alternatively I would like to have a button to open the add form for nominals to insert the new item and coming back to the unchanged coin form where I left it - hopefully the reference of the new nominal inserted. Can anyone give me a leed to an example or a tutorial for a newbie? I think I have to delve into Ajax - right? Thanks a lot. -- 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 2: Very confusing docs/tutorials... Is there another foolproof source?
Hi all, Sorry if this is another dumb post, but I get the feeling that the tutorials and docs are written with experienced Cake people in mind, rather than Cake novices. For example, after completing the Blog tutorial, it suggests reading up on Layouts, which I did next. At http://book.cakephp.org/2.0/en/views.html#view-layouts it says, When you create a layout, you need to tell CakePHP where to place the code for your views. To do so, make sure your layout includes a place for $this-fetch('content'). So I replace my /app/View/Layouts/ default.ctp (that I copied from the /lib/Cake/View/Layouts) with the suggested layout shown on that page, and now my Blog app craps out. Then I revert to the good version and it works again. Ok, not to worry, I'll go on. So, I take a look at /app/View/Layouts/default.ctp (that I copied from the /lib/Cake/View/Layouts) and search for the essential part, $this- fetch('content'). But, it's nowhere to be seen. In fact, fetch() does not seem to be defined anywhere at all in the whole bundle, and I can't find a definition for fetch() in the PHP docs either? So, now I'm wondering if the docs are BS as default.ctp that comes bundled with Cake doesn't even have any mention of this seemingly essential line? Then I take another look at /app/View/Layouts/default.ctp to see if I can figure it out what it does. The very first line is $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework'); There are no comments at all to go with it. So I try to look up what __d() does and I get this from the docs: __d Allows you to override the current domain for a single message lookup. Clear as mud. No explanation of what's meant by domain or message. Are we talking about dotcoms here, or a set of values? The latter, I assume, but I can only imagine how many non-English speakers scratch their head til it bleeds after reading that. And still I'm really not sure what __d() does. I'm sorry if this reads very negatively, and I greatly appreciate the work done by the CakePHP teams and volunteers, but I'm sure Cake would be adopted a lot more widely if it was friendlier to novices (I'm certainly not a PHP novice, but I'm new to Cake). 99% of the tutorials out there are written for the last version of Cake, and don't work for Cake 2 (no doubt they can easily be adapted for Cake 2, but for a novice, they should work 100% when copying and pasting... A novice can't be expected to adapt someone else's code, just when they're learning it). I think I would advise noobs to start off with Cake 1, as there's a lot more stuff out there for it, and it's very hard to figure out what's going on in Cake 2, especially if you wander astray for a moment, and Google won't help much either. I know no one buys a book to learn this stuff anymore, but even if you wanted to, you couldn't. Just some initial thoughts, I hope it starts to get better... Glen. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
Double underscore functions are translating functions, which allow you to internationalize your application. (You can always look at the code to try and figure out what it does - it's also a great way to learn!) Cake is a large project, so there will always be things missing from the docs. Feel free to contribute as you figure things out and find what's missing. There are a few books on CakePHP 1.3 (Mariano's comes to mind), but CakePHP 2 is very new so you won't find any. And you're right, generally you don't see books because they become dated quickly. If you have little questions like what does __d() do, you can always ask on IRC. Most people are pretty helpful. Don't give up hope! We're all always trying to improve CakePHP with better docs and user contributed content. It's all created on volunteer time so it's important to understand there's only so much the core team can do. -jeremy -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
Thanks Jeremy. I really didn't want to come off negative (how can I when I'm getting this thing for free, paid for by other people's hard work), I just wanted to put a noob's perspective out there. It's really frustrating to walk into dark caves so often when you're trying to learn something new, and when you think you've found a way out, it's another dead end. If I ever get any level of skill with Cake I will most definitely add to or update the docs. I haven't given up on Cake, but I'm wondering if Cake 1 would be a wiser choice for now. Thanks, Glen. On Jan 12, 7:23 pm, jeremyharris funeralm...@gmail.com wrote: Double underscore functions are translating functions, which allow you to internationalize your application. (You can always look at the code to try and figure out what it does - it's also a great way to learn!) Cake is a large project, so there will always be things missing from the docs. Feel free to contribute as you figure things out and find what's missing. There are a few books on CakePHP 1.3 (Mariano's comes to mind), but CakePHP 2 is very new so you won't find any. And you're right, generally you don't see books because they become dated quickly. If you have little questions like what does __d() do, you can always ask on IRC. Most people are pretty helpful. Don't give up hope! We're all always trying to improve CakePHP with better docs and user contributed content. It's all created on volunteer time so it's important to understand there's only so much the core team can do. -jeremy -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
The changes in 2.0 are well worth the learning curve. I'd say that the learning curve is the same if you're starting from scratch. It's really the concepts that are what you need to get your head around first. And I didn't take you as negative, and I know the core team would appreciate that you recognize all of their hard work :) I understand your frustration. It was hard for me to start up as well, but once you dive in learn, you'll find it pays off multiple times over down the road. There are video tutorials here: http://tv.cakephp.org/ You can also sign up for training classes here: http://training.cakephp.org/ The classes are taught by a couple of very skilled core team friends of mine, and I know will be worth the money. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
To do so, make sure your layout includes a place for $this-fetch('content'). Don't use CakePHP 2.1-alpha (codebase and/or documentation) yet - learn latest stable. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
@jeremyharris There are video tutorials here: http://tv.cakephp.org/ You can also sign up for training classes here: http://training.cakephp.org/ - thanks, that sounds like a very good idea, I guess there's a QA part in those courses? @100rk Don't use CakePHP 2.1-alpha (codebase and/or documentation) yet - learn latest stable. - the $this-fetch('content') line is in the 2.0 docs? http://book.cakephp.org/2.0/en/views.html#view-layouts -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
I'm not sure if a Q/A is provided, simply because so many people will be attending. Tweet @cakephp and ask them and they will be able to better assist you about the training videos. -- 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
default layout after view instead of inside
Hi, I have a problem with cakephp 2.0.5. I modified the default view en home.ctp and it works like it should. But when i create a view (views/users/login.ctp) the login view generated before the default view. The view should be inside the default view where content for layout is located. It works with home.ctp but not with other views. Anybody got an idea what i'm doing wrong? I think it has to do with my smarty helper. Here's the code. ?php Class SmartyView extends View{ function __construct ($controller) { parent::__construct($controller); if (is_object($controller)) { $count = count($this-__passedVars); for ($j = 0; $j $count; $j++) { $var = $this-__passedVars[$j]; $this-{$var} = $controller-{$var}; } } if(!App::import('Vendor', 'Smarty', array('file' = 'smarty'.DS.'Smarty.class.php'))) die('error Loading Smarty Class'); $this-Smarty = new Smarty(); $this-ext= '.tpl'; $this-Smarty-compile_dir = TMP.'smarty'.DS.'compile'.DS; $this-Smarty-cache_dir = TMP.'smarty'.DS.'cache'.DS; //TODO turn caching on. caching is off while debugging $this-Smarty-caching=FALSE; $this-Helpers = new HelperCollection($this); } protected function _render($___viewFn, $___dataForView = array()) { if (empty($___dataForView)) { $___dataForView = $this-viewVars; } extract($___dataForView, EXTR_SKIP); foreach($___dataForView as $data = $value) { if(!is_object($data)) { $this-Smarty-assign($data, $value); } } //assign session for debugging $this-Smarty-assign('_SESSION', $_SESSION); //assign view for use in elements $this-Smarty-assign('View', new View(null)); $this-Smarty-display($___viewFn); } //overrides the function from lib/cake/view/view.php. Makes helpers available to smarty public function loadHelpers() { $helpers = HelperCollection::normalizeObjectArray($this- helpers); foreach ($helpers as $name = $properties) { list($plugin, $class) = pluginSplit($properties['class']); $this-{$class} = $this-Helpers- load($properties['class'], $properties['settings']); $this-Smarty-assign($name, $this-{$class}); } $this-_helpersLoaded = true; } } ? Any help is appreciated. -- 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
No image for captcha
I followed the article on: http://bakery.cakephp.org/articles/spout/2007/06/09/captcha-component-with-phpcaptcha ...and made some changes to the controller given there: ?php App::import('Vendor', 'phpcaptcha/phpcaptcha'); class CaptchaComponent extends Component { var $controller; function startup( $controller ) { $this-controller = $controller; } function image() { $imagesPath = APP . 'Vendor' . DS . 'phpcaptcha'.'/fonts/'; $aFonts = array( $imagesPath.'VeraBd.ttf', $imagesPath.'VeraIt.ttf', $imagesPath.'Vera.ttf' ); $oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60); $oVisualCaptcha-UseColour(true); //$oVisualCaptcha-SetOwnerText('Source: '.FULL_BASE_URL); $oVisualCaptcha-SetNumChars(6); $oVisualCaptcha-Create(); } function audio() { $oAudioCaptcha = new AudioPhpCaptcha('/usr/bin/flite', '/ tmp/'); $oAudioCaptcha-Create(); } function check($userCode, $caseInsensitive = true){ if ($caseInsensitive) $userCode = strtoupper($userCode); $csi = $this-Session-read(CAPTCHA_SESSION_ID); if (($this-Session-check(CAPTCHA_SESSION_ID)) ($userCode == $csi)) { $this-Session-delete(CAPTCHA_SESSION_ID); return true; } else return false; } } ? I added code to my add.ctp view file: img id=captcha src=?php echo $this-Html-url('/users/ captcha_image');? alt= / a href=javascript:void(0); onclick=javascript:document.images.captcha.src='?php echo $this- Html-url('/users/captcha_image');??' + Math.round(Math.random(0)*1000)+1Reload image/a I didn't change the PhpCaptcha file by Edward Eliot. I don't get any errors but the captcha image just shows a red cross. I also tried some old PHP code (no Cake) that I had for doing captchas but the webpage just showed a red cross too. I am wondering if there is a change in the way in which PHP deals with generated images. Thanks. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
- the $this-fetch('content') line is in the 2.0 docs?http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
the 2.0 section of book notes which features are 2.1 specific what is phased out too - S On 13 January 2012 02:19, 100rk lubomir.st...@gmail.com wrote: - the $this-fetch('content') line is in the 2.0 docs? http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
A couple of months ago I was new to cakephp and php in general. The book was fine for documentation, but what I really lacked were concrete examples of how many things were used, or options of things that could be used for scenarios. I spent a LOT of time looking at other peoples code from github and various other places from google searches. Sometimes the only examples I could find were from older versions that didn't apply in an easy way for my mind to understand for 2.0+. I'm not new to programming at all, but I have to admit, I'd have rather paid a hundred dollars for a couple of books that were filled with examples using the latest versions. Currently with php / cakephp I am non profitable, hoping to at some point in the not too distant future make some money. I wouldn't mind paying a little to have some functionality explained or created for me, but it's hard to justify spending my hard earned day job money to hire a contract developer, when I'm not making a profit and should be able to learn it myself. I'm truly grateful to everyone on this list who has helped me, and to everyone who has contributed (I hope I can too in the future), but I have definitely struggled to do some things the cake way vs the way I did things before using other languages and frameworks. On Thu, Jan 12, 2012 at 9:33 PM, Sam Sherlock sam.sherl...@gmail.comwrote: the 2.0 section of book notes which features are 2.1 specific what is phased out too - S On 13 January 2012 02:19, 100rk lubomir.st...@gmail.com wrote: - the $this-fetch('content') line is in the 2.0 docs? http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
@justin no printed books for cake 2.0 yet. The cake training sessions sound like what your after and also checkout the videos on the tv site. get on irc for interactive help - S On 13 January 2012 04:53, Justin Edwards justinledwa...@gmail.com wrote: A couple of months ago I was new to cakephp and php in general. The book was fine for documentation, but what I really lacked were concrete examples of how many things were used, or options of things that could be used for scenarios. I spent a LOT of time looking at other peoples code from github and various other places from google searches. Sometimes the only examples I could find were from older versions that didn't apply in an easy way for my mind to understand for 2.0+. I'm not new to programming at all, but I have to admit, I'd have rather paid a hundred dollars for a couple of books that were filled with examples using the latest versions. Currently with php / cakephp I am non profitable, hoping to at some point in the not too distant future make some money. I wouldn't mind paying a little to have some functionality explained or created for me, but it's hard to justify spending my hard earned day job money to hire a contract developer, when I'm not making a profit and should be able to learn it myself. I'm truly grateful to everyone on this list who has helped me, and to everyone who has contributed (I hope I can too in the future), but I have definitely struggled to do some things the cake way vs the way I did things before using other languages and frameworks. On Thu, Jan 12, 2012 at 9:33 PM, Sam Sherlock sam.sherl...@gmail.comwrote: the 2.0 section of book notes which features are 2.1 specific what is phased out too - S On 13 January 2012 02:19, 100rk lubomir.st...@gmail.com wrote: - the $this-fetch('content') line is in the 2.0 docs? http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
I echo Justin's sentiment. Perhaps it's up to all of us to edit the online docs adding examples that have helped us. I know I am bad at that. Jeremy Burns Class Outfit http://www.classoutfit.com On 13 Jan 2012, at 05:02:47, Sam Sherlock wrote: @justin no printed books for cake 2.0 yet. The cake training sessions sound like what your after and also checkout the videos on the tv site. get on irc for interactive help - S On 13 January 2012 04:53, Justin Edwards justinledwa...@gmail.com wrote: A couple of months ago I was new to cakephp and php in general. The book was fine for documentation, but what I really lacked were concrete examples of how many things were used, or options of things that could be used for scenarios. I spent a LOT of time looking at other peoples code from github and various other places from google searches. Sometimes the only examples I could find were from older versions that didn't apply in an easy way for my mind to understand for 2.0+. I'm not new to programming at all, but I have to admit, I'd have rather paid a hundred dollars for a couple of books that were filled with examples using the latest versions. Currently with php / cakephp I am non profitable, hoping to at some point in the not too distant future make some money. I wouldn't mind paying a little to have some functionality explained or created for me, but it's hard to justify spending my hard earned day job money to hire a contract developer, when I'm not making a profit and should be able to learn it myself. I'm truly grateful to everyone on this list who has helped me, and to everyone who has contributed (I hope I can too in the future), but I have definitely struggled to do some things the cake way vs the way I did things before using other languages and frameworks. On Thu, Jan 12, 2012 at 9:33 PM, Sam Sherlock sam.sherl...@gmail.com wrote: the 2.0 section of book notes which features are 2.1 specific what is phased out too - S On 13 January 2012 02:19, 100rk lubomir.st...@gmail.com wrote: - the $this-fetch('content') line is in the 2.0 docs?http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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 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 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
Problem with Paginate (Cake 2.0.5)
I have followed the 2.0 book to add pagination to a controller/view. I get the paginate controls and they are rendering correctly (they *think* I'm doing things like next page and sort when I click on the links since they change their counts and links) however the data returned isn't paginated. I should only be seeing 10 posts, but I am getting all posts in the database (about 30) no matter what I click on. Any pointers? The code in the PostsController.php looks like: ?php class PostsController extends AppController { public $name = 'Posts'; public $helpers = array('Html', 'Form', 'Paginator'); public $components = array('Session'); public $paginate = array( 'limit' = 5, 'order' = array( 'Post.title' = 'asc' ) ); public function news() { $this-paginate ('Post'); $this-set('posts', $this-Post-find('all')); } The code in the view looks like: table tr th width=25%?php echo $this-Paginator-sort('title', 'Title'); ?/th th?php echo $this-Paginator-sort('body', 'Content'); ?/ th /tr ?php foreach ($posts as $post): ? tr td?php echo $post['Post']['title']; ? /td td?php echo $post['Post']['body']; ? /td /tr ?php endforeach; ? /table ?php // Shows the page numbers echo $this-Paginator-numbers(); // Shows the next and previous links echo $this-Paginator-prev('« Previous', null, null, array('class' = 'disabled')); echo $this-Paginator-next('Next »', null, null, array('class' = 'disabled')); // prints X of Y, where X is current page and Y is number of pages echo $this-Paginator-counter(); ? -- 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: Cake 2: Very confusing docs/tutorials... Is there another foolproof source?
@Justin I'm in the same boat as you, although I have about 4 years of using CakePHP under my belt. I have a couple of personal projects that I'm working on to hopefully make some extra cash. In the meantime though, I get to use Cake at work for some projects there, so I'm able to stay in practice even if I'm not benefiting my own projects. My suggestion (and what worked for me) was to use a combination of the tools that you mentioned. Google searches, Cake Docs, Github, and stumbling around and learning from my many mistakes. It has taken some time, but for me I'm not sure that a book would have been easier. I try to stay on top of the new releases that come out, and thanks so much to the core team, because each release is a big improvement from previous releases. Good documentation is the hardest part of development. @burntcake: If you have a project in mind, plan it out, and then attack each step one at a time, feel free to ask questions on here, and IRC. People are quick with answers especially if you have a well laid out question with code and results of that code. My experience has been that if it looks like you are putting in effort to understanding something rather than just asking for help right away, I have had good success getting answers. If you're learning anyways, go with 2.0! Russ On Jan 12, 8:53 pm, Justin Edwards justinledwa...@gmail.com wrote: A couple of months ago I was new to cakephp and php in general. The book was fine for documentation, but what I really lacked were concrete examples of how many things were used, or options of things that could be used for scenarios. I spent a LOT of time looking at other peoples code from github and various other places from google searches. Sometimes the only examples I could find were from older versions that didn't apply in an easy way for my mind to understand for 2.0+. I'm not new to programming at all, but I have to admit, I'd have rather paid a hundred dollars for a couple of books that were filled with examples using the latest versions. Currently with php / cakephp I am non profitable, hoping to at some point in the not too distant future make some money. I wouldn't mind paying a little to have some functionality explained or created for me, but it's hard to justify spending my hard earned day job money to hire a contract developer, when I'm not making a profit and should be able to learn it myself. I'm truly grateful to everyone on this list who has helped me, and to everyone who has contributed (I hope I can too in the future), but I have definitely struggled to do some things the cake way vs the way I did things before using other languages and frameworks. On Thu, Jan 12, 2012 at 9:33 PM, Sam Sherlock sam.sherl...@gmail.comwrote: the 2.0 section of book notes which features are 2.1 specific what is phased out too - S On 13 January 2012 02:19, 100rk lubomir.st...@gmail.com wrote: - the $this-fetch('content') line is in the 2.0 docs? http://book.cakephp.org/2.0/en/views.html#view-layouts Probably some mistake (book.cakephp.org updated too soon, or missing node for 2.1.x docs, I don't know) - View::fetch() is 2.1 feature. -- 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 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: Installation problem with newly baked app
Hi Daniel, I haven't used WAMP to setup, but I do have Cake 2.0 installed on a Windows 7 machine. (as well as Linux and Vista). One thing to check would be your .htaccess files (there is one at the base cake installation, the app folder, and the webroot folder. Also make sure in your WAMP settings that you have mod_rewrite enabled. Hope that helps, or points you in the right direction... Russ -- 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: Installation problem with newly baked app
Open index.php and test.php in webroot. A line which includes lib/Cake is commented out - uncomment it. - S On 13 Jan 2012 07:46, Russ russ.philip...@gmail.com wrote: Hi Daniel, I haven't used WAMP to setup, but I do have Cake 2.0 installed on a Windows 7 machine. (as well as Linux and Vista). One thing to check would be your .htaccess files (there is one at the base cake installation, the app folder, and the webroot folder. Also make sure in your WAMP settings that you have mod_rewrite enabled. Hope that helps, or points you in the right direction... Russ -- 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