Paginating an associated model

2012-07-03 Thread Ronen Amiel
Hey everyone, I have a page in my application where I show information about 1 category and all of it's products (category hasMany product, product belongsTo category). I have been using a call to $this->Category->find() supplying it with conditions and containments to get something like that f

How can I add months to a date?

2012-07-03 Thread Steven Scaffidi
I want to be able to add a certain amount of months to date. Basically I have a from in order to start a new product. In the form, there is a begin date that the user select (this is a date). I want to add a variable amount of months to that date and then save that date into another field. How c

Re: CMS with cakephp

2012-07-03 Thread Greg Skerman
both have live demos, you can go try it and decide the answer to that yourself. For what its worth, even though WP is easy to use from a user/admin perspective, I find authoring plugins and extending functionality on WP to be an absolute headache...doesn't feel very developer friendly to me. On

Re: re-skinned or plugin version or my site.. like an API but templated

2012-07-03 Thread Greg Skerman
cake pretty much provides an api out of the box for each of your controllers. Look at the relevant chapters on REST in the book. Essentially you configure the request handler and turn on parse extensions and do some minor tweaking in the controller logic.. so if someone hits http://yourwebsite.co

Biiling System with Cakephp

2012-07-03 Thread Mr. Manager
Dear All, I would like to create billing system with cakephp that is similar to window app, which show the data in datagridview and add record in datagrid, especially behind the sense modify record. In short we want to work with data like desktop application. And one more in this system i want

Re: CMS with cakephp

2012-07-03 Thread Marcelo Custódio
Well, in a certain way, I foresaw that answer. Thanks. The remaing question: are they as easy to use as WP ? Thanks again Abraços, MARCELO CUSTÓDIO On Tue, Jul 3, 2012 at 5:35 PM, lowpass wrote: > Wordpress isn't CakePHP, which can be handy if the site requires more > than just simple CMS

Re: Login problem

2012-07-03 Thread Paulo Victor
Yes, in my users controller : public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('add_bolsista','logout'); } Wich is different from my appcontroller beforeFilter: public function beforeFilter() { $this->Auth->allow('index','view'); $this->set('l

Re: Login problem

2012-07-03 Thread lowpass
Are you calling beforeFilter() in your controller? If so, do you also call parent::beforeFilter()? On Tue, Jul 3, 2012 at 6:15 PM, Paulo Victor wrote: > Well, still shows the same problem. In the other Controller i override this > method like this: > > public function isAuthorized($usuario = nu

Re: Login problem

2012-07-03 Thread Paulo Victor
Well, still shows the same problem. In the other Controller i override this method like this: public function isAuthorized($usuario = null) { if (($usuario['Status'] == 'Super') || ($usuario['Status'] == 'Coordenador')) { return true; } if (in_array($this->action, array('edit

Re: Method from controller is not mapped

2012-07-03 Thread lowpass
That doesn't seem to be a rewrite issue. What do your routes for UsersController, if any, look like? Do you have the following in routes.php? require CAKE . 'Config' . DS . 'routes.php'; And if you have access to the server's Apache config, you'll speed up the site a bit by putting the rewrite ru

Re: CMS with cakephp

2012-07-03 Thread lowpass
Wordpress isn't CakePHP, which can be handy if the site requires more than just simple CMS capabilities. On Tue, Jul 3, 2012 at 11:06 AM, Marcelo Custódio wrote: > So what are the advantages of Croogo and QuickAppsCMS over Wordpress, an > easy-to-use and very popular CMS ? > > > > Abraços, > > MA

Re: AuthComponent, set userScope in appController

2012-07-03 Thread lowpass
On Tue, Jul 3, 2012 at 8:31 AM, Lucas Simon Rodrigues Magalhaes wrote: > The error appear in this line: > 'scope' => array('User.status' => Configure::read('User.ACTIVE')), And on that line you are declaring a class member. You cannot use Configure::read() there. http://www.php.net/manual/en/lan

Re: Integrated PHPWord to CakePhp

2012-07-03 Thread lowpass
Install phpword in the app/Vendors directory. Then create a component to use the library to do what you want. Look online for "cakephp component" and you should find a lot of examples to work from. Just be aware of changes between 1.2.x and 2.x because you might come across some older howtos. http

Re: re-skinned or plugin version or my site.. like an API but templated

2012-07-03 Thread elogic
Thanks, I think it might need to be via an API seeing it needs to be apart of their actual website. Does anyone know of any tutorials online covering creating an API with cakephp so I can look into this further? It's all very new to me, I have used API's but never created one with or without cak

Re: url=controller/function appears now in my url address bar

2012-07-03 Thread Adam Symonds
Thanks, I did miss it. This did the trick. Regards, Adam Symonds Elogic Media On Wed, Jul 4, 2012 at 5:24 AM, lowpass wrote: > On Tue, Jul 3, 2012 at 12:46 AM, elogic > wrote: > > I checked this all out but I couldn't see anything that was wrong. > > Perhaps you missed it: > > RewriteRule ^

Re: url=controller/function appears now in my url address bar

2012-07-03 Thread lowpass
On Tue, Jul 3, 2012 at 12:46 AM, elogic wrote: > I checked this all out but I couldn't see anything that was wrong. Perhaps you missed it: RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] vs RewriteRule ^(.*)$ index.php [QSA,L] It's the one in app/webroot that you need to change. That, or your vho

Re: Print Msg No record found

2012-07-03 Thread lowpass
controller: $this->set('data', $this->YourModel->find(...)); view: if (empty($this->data['YourModel'])) ... But your requirements may be peculiar to your app. In the view, include debug($data) to see the contents. (Set debug to 2 in bootstrap.php) On Tue, Jul 3, 2012 at 6:13 AM, Prateek Dixit

Re: Ajax pagination returns the whole page instead of the requested div

2012-07-03 Thread lowpass
I can't speak to the example code you provided as I don't use Cake's JSHelper for AJAX. Does the full layout include the data you wanted? Or does it just have what you'd see when first arriving at the page? Does your controller action have a redirect? Does the returned HTML include an error or not

Re: Why using HTML->link instead of manually writing an anchor text ?

2012-07-03 Thread lowpass
On Sun, Jul 1, 2012 at 5:12 AM, rchavik wrote: > > > On Sunday, July 1, 2012 8:38:36 AM UTC+7, Marcelo Custódio wrote: >> >> Isn't it much slower concerning development time ? >> >> What are the advantages of of HTML->link ? > > > It understands your routes. ++ on that. If the client suddenly wan

Re: Manage large multilingual project

2012-07-03 Thread lowpass
Agreed. The only caveat, though, is that if another person will be doing the translation, having the full sentence available will be necessary in most cases. Otherwise, yeah, use keys. Far easier to deal with. On Sun, Jul 1, 2012 at 4:45 PM, Miles J wrote: > One thing I want to point out, is tha

Re: mod_rewrite

2012-07-03 Thread lowpass
RewriteRule ^dev/.*$ - [PT] It would be simpler to create virtual hosts, though. On Sat, Jun 30, 2012 at 6:25 PM, advantage+ wrote: > I have my main site in the app folder / directory > > Now I want to create a dev folder where I can work on a new site but going > to site.com/dev results in Erro

Re: Completely blank screen after form submission

2012-07-03 Thread lowpass
There's not really one single answer to that. It really depends on your application. The basic approach is to use .po files, however, this is not a great solution for dynamic text from the database. One approach is to have a single table with translations for many types of models. Another way -- if

Re: Method from controller is not mapped

2012-07-03 Thread Cosmin Paul
sry for this, I've resubmitted from draft folder. Has some-one a clue on this ? This is my virtual host: ServerName mysite ServerAdmin webmaster@localhost DocumentRoot /home/cosminct/workspace/www/mysite/app/webroot Options FollowSymLinks AllowOverride All

Re: Login problem

2012-07-03 Thread Cosmin Paul
Make sure you call parent class, If you over-right the `isAuthorized` method. return parent::isAuthorized($user); Maybe this helps you, Cheers Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.o

Method from controller is not mapped

2012-07-03 Thread Cosmin Paul
Hi, I set-up cake and I have a problem that google can't answer: http://mysite/users/add on this URL: http://mysite/users/ -- -- 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

Method from controller is not mapped

2012-07-03 Thread Cosmin Paul
Hi, I set-up cake and I have a problem that google can't answer, I am stuck on this and I can't find an answer. For http://mysite/users/ It works For http://mysite/users/add `Create the class AddController below in file: app/Controller/AddController.php` But this is a method from Users controll

Re: Get full path with file input ? (IMGUR related)

2012-07-03 Thread JonStark
It did the trick ! Thans a lot :) Le lundi 2 juillet 2012 12:47:06 UTC+2, JonStark a écrit : > > I'm trying to add a file upload to a form in cake 2.x : > > Controller : > > public function add() { >> >> if ($this->request->is('post')) { >> $this->request->data['Post']['user_id'] =

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-03 Thread stork
Just change last line of APP/webroot/index.php and call dispatcher with your custom request class. #APP/Lib/Network/AppRequest.php App::uses('CakeRequest', 'Network'); class AppRequest extends CakeRequest { ... } #APP/webroot/index.php ... App::uses('AppRequest', 'Network'); $Dispatcher->dispatc

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-03 Thread Max Dörfler
Hi, have you tried copying the core "CakeRequest.php" to "app/Lib/Cake/Network/CakeRequest.php" and do your changes there? I think I remeber doing something like this with the Dispatcher and cake automagically used the one from the app. The problem I had back then was that I had to copy the w

Login problem

2012-07-03 Thread Paulo Victor
I don't know what do do anymore. My login system is up and runnig, but no matter what, always denyes access, even with registered users, with hashed password. My AppController: class AppController extends Controller { public $components = array( 'Session', 'Auth'=>array(

Re: CMS with cakephp

2012-07-03 Thread Marcelo Custódio
So what are the advantages of Croogo and QuickAppsCMS over Wordpress, an easy-to-use and very popular CMS ? Abraços, MARCELO CUSTÓDIO On Tue, Jul 3, 2012 at 5:29 AM, Mohammad Naghavi wrote: > I wanted once to start working on a MODULE that can replace the static > pages but not more than

Print Msg No record found

2012-07-03 Thread Prateek Dixit
When i have no record in my database table then how to print No record found error in my page -- 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 question

Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-03 Thread Tom Cowle
My web hosting in on a load balanced server, which means that HTTPS cannot be detected in the usual way. My host includes a custom header which allows detection of HTTPS. This means that the CakePHP request->isSSL() functionality does not work out of the box. I can fix this easily in Lib/Cake/

Re: Completely blank screen after form submission

2012-07-03 Thread Shosho
How would you suggest I do it differently? I'm still pretty new to cake. -- View this message in context: http://cakephp.1045679.n5.nabble.com/Completely-blank-screen-after-form-submission-tp5709166p5709256.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our newest site for th

Re: syntax error, unexpected T_CLASS

2012-07-03 Thread Serkan Sipahi
use Netbeans ;) Von: David Lozzi An: cake-php@googlegroups.com Gesendet: 15:45 Dienstag, 3.Juli 2012 Betreff: Re: syntax error, unexpected T_CLASS Holy sucky-IDE Batman! That worked!! GAH that's frustrating. I'm using Komode Edit for my IDE, which obviousl

Re: syntax error, unexpected T_CLASS

2012-07-03 Thread David Lozzi
Holy sucky-IDE Batman! That worked!! GAH that's frustrating. I'm using Komode Edit for my IDE, which obviously didn't pick up on that. What IDE do you use? Thanks a million!! David On Monday, July 2, 2012 7:21:49 PM UTC-4, MaJerle.Eu wrote: > > > it should be > check line 1 :) > -- > Lep p

Re: AuthComponent, set userScope in appController

2012-07-03 Thread Lucas Simon Rodrigues Magalhaes
The error appear in this line: 'scope' => array('User.status' => Configure::read('User.ACTIVE')), Em segunda-feira, 2 de julho de 2012 18h50min00s UTC-3, MaJerle.Eu escreveu: > > because this is php error > > you can not use methods/functions when declaring properties in class > > use this in App

Re: Get full path with file input ? (IMGUR related)

2012-07-03 Thread Dr. Tarique Sani
enctype="multipart/form-data" ? http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options-for-create HTH Tarique On Tue, Jul 3, 2012 at 4:36 PM, JonStark wrote: > Does someone has any clue ? Still stuck with this... thanks a lot. > > Le lundi 2 juillet 2012 12:47:06 UTC+2, JonSta

Re: Get full path with file input ? (IMGUR related)

2012-07-03 Thread JonStark
Does someone has any clue ? Still stuck with this... thanks a lot. Le lundi 2 juillet 2012 12:47:06 UTC+2, JonStark a écrit : > > I'm trying to add a file upload to a form in cake 2.x : > > Controller : > > public function add() { >> >> if ($this->request->is('post')) { >> $this->r

Integrated PHPWord to CakePhp

2012-07-03 Thread adikhaiirul
Anyone can help me please.. I want to create report from cakephp to ms.word using PHPWord ( http://phpword.codeplex.com/ ). any one can tell me what should i do.. Thanks before. Best Regards... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out th

Re: User list in a plugin

2012-07-03 Thread tigr
Hi! In order to use the model relationships, you first must set them up. In the definition of the Event model, how does it relate to the User model? Cheers On Monday, July 2, 2012 11:09:29 AM UTC+2, Francesco Pantisano wrote: > > Hi, > i have installend a plugin on cakephp2, > but now i want to

Re: CMS with cakephp

2012-07-03 Thread Mohammad Naghavi
I wanted once to start working on a MODULE that can replace the static pages but not more than that. I mean having a complete CMS is sometimes not the right solution because I just want to replace the static pages and the way they are edited statically with a dynamic online solution where pages cou

Re: Adding form posted data into URL

2012-07-03 Thread Davor Ilic
did you solve your issue? 2012/6/17 Mir Ali > > Hi, > > I have three sliders like > *http://www.uswitch.com/mobiles/* under > "Find your perfect mobile deal" section. > > Once these sliders are moved I want to add those values inside the url > just like uswitch.

Re: actAs "Tree" : generatetreelist error

2012-07-03 Thread Davor Ilic
goog to know thank you 2012/6/18 Ish > Had the same problem in cakephp 2.0 > > Later realized *generatetreelist* function got renamed to * > generateTreeList* > > On Thursday, January 27, 2011 9:44:58 PM UTC-5, raymond wrote: >> >> Hi. >> I have tried Tree behavior just according to manual, but

Re: Autocomplete field to populate a select input example?

2012-07-03 Thread Michael Gaiser
I got it working. Thanks. On Tue, Jul 3, 2012 at 12:37 AM, Борислав Събев wrote: > Hi there. > > I am assuming that you've got he autocomplete working. So what you > basically need to do is to make an ajax call to retrieve all cities in that > state once it is entered. > The ajax call should call

Re: CMS with cakephp

2012-07-03 Thread Davor Ilic
i also agree Tarique and Chetan Patel 2012/6/28 Chetan Patel > You have another option for CMS in cakephp > > http://www.quickappscms.org/ > > Thanks > Chetan > > > On Thu, Jun 28, 2012 at 12:19 PM, Miles J wrote: > >> Just use Croogo >> >> http://croogo.org/ >> >> >> On Wednesday, June 27, 2012