ACL or just Auth?
Hi bakers, I'm a cake newbie. I am seeking for a suggestion on whether to use ACL or Auth component only. My application is blog-like. There are 3 levels of users - admin, moderation, and author (normal user). In this case, I am not sure whether Auth component alone is sufficient for user management/permission or should I use ACL also? I find it hard to get ACL to work so if Auth is suitable I'll only go for Auth. Thanks in advance. Cheers. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2xx better label or table layout?
There are several ways to deal with this. First, you can have Form write the labels/inputs in different ways: $form->input('...', array('label' => 'my label', ...)) gives you: my label but ... $form->label('...', 'my label') $form->input('...', array('label' => false, ...)) gives you: my label and ... $form->input('...', array('div' => false, 'label' => 'my label', ...)) gives: my label Just with that, one has a lot of options for setting CSS rules. Plus, it's possible to specify a class for the label, as well. The other possibility is to override how Form creates the markup. Have a look at Form::input() in cake/libs/view/helpers/form.php On Sat, May 31, 2008 at 12:08 PM, Alessio <[EMAIL PROTECTED]> wrote: > > I am making my site... > What suggestion... > I want to know what it is better.. > Using the label or using table layout... > > Helper $form generates a new line..after label... > What do you prefer usually, using lable or table...? > I know W3c suggests not using tables..,but i think that it is very > confortable...tables.. > > If I want the label and change style every time? > Very thanks... > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing language of date helper, better in core or other?
~sigh~ That was the corrolary to blogica's Law of looking like a 'tard online. Never mind, I misread the trac thread. Works for me. On Sat, May 31, 2008 at 11:07 PM, b logica <[EMAIL PROTECTED]> wrote: > It's too bad that Form was written this way. I was hoping this array > would be created in the constructor as a member variable rather than > (re)created every time it's required. Aside from seeming inefficient, > I was thinking of writing a routine to update $form where needed, > instead of having to patch something in core. > > On Sat, May 31, 2008 at 10:54 PM, b logica <[EMAIL PROTECTED]> wrote: >> Hey, thanks. I'd noticed a few days ago that this was an issue and >> forgot to follow up on it. >> >> On Sat, May 31, 2008 at 2:12 PM, Dardo Sordi Bogado >> <[EMAIL PROTECTED]> wrote: >>> >>> You might like to see this: https://trac.cakephp.org/ticket/4409 >>> >>> On Sat, May 31, 2008 at 1:12 PM, Alessio <[EMAIL PROTECTED]> wrote: I need to use the months in italian... What do you suggest? Change in core...or just create some helper or bridge...to convert the array...maybe before of rendering... In general I don't want to modify the core... > >>> >>> >>> >>> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing language of date helper, better in core or other?
It's too bad that Form was written this way. I was hoping this array would be created in the constructor as a member variable rather than (re)created every time it's required. Aside from seeming inefficient, I was thinking of writing a routine to update $form where needed, instead of having to patch something in core. On Sat, May 31, 2008 at 10:54 PM, b logica <[EMAIL PROTECTED]> wrote: > Hey, thanks. I'd noticed a few days ago that this was an issue and > forgot to follow up on it. > > On Sat, May 31, 2008 at 2:12 PM, Dardo Sordi Bogado > <[EMAIL PROTECTED]> wrote: >> >> You might like to see this: https://trac.cakephp.org/ticket/4409 >> >> On Sat, May 31, 2008 at 1:12 PM, Alessio <[EMAIL PROTECTED]> wrote: >>> >>> I need to use the months in italian... >>> What do you suggest? >>> Change in core...or just create some helper or bridge...to convert the >>> array...maybe before of rendering... >>> In general I don't want to modify the core... >>> > >>> >> >> >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing language of date helper, better in core or other?
Hey, thanks. I'd noticed a few days ago that this was an issue and forgot to follow up on it. On Sat, May 31, 2008 at 2:12 PM, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote: > > You might like to see this: https://trac.cakephp.org/ticket/4409 > > On Sat, May 31, 2008 at 1:12 PM, Alessio <[EMAIL PROTECTED]> wrote: >> >> I need to use the months in italian... >> What do you suggest? >> Change in core...or just create some helper or bridge...to convert the >> array...maybe before of rendering... >> In general I don't want to modify the core... >> > >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Static pages
On Sat, May 31, 2008 at 1:00 PM, Turnquist, Jonah <[EMAIL PROTECTED]> wrote: > > Hey I'm just starting to learn cakephp and have a question... I was > wondering what the best way to handle static pages and the home page > is. This is what I've done: > > In the routes file I added: > Router::connect('/', array('controller' => 'pages')); > > And I commented out these two lines: > //Router::connect('/', array('controller' => 'pages', 'action' => > 'display', 'home')); > //Router::connect('/pages/*', array('controller' => 'pages', 'action' > => 'display')); > > So now the top directory (the home page) routes to PagesController- >>index(); and it uses the view pages/index.ctp > Furthermore if I want a static /about page I create the route: > Router::connect('/about', array('controller' => 'pages/about')); > And now /about routes to PagesController->about(); and uses the view > at pages/about.ctp > > Using this method I have to create a new route for every static page > as well as add an event for each static page in the PagesController. > One way i handled this was to create a route for each page, like you have, but I used wildcards for anything within a directory Router::connect('/contact', array('controller' => 'pages', 'action' => 'display', 'contact')); Router::connect('/links', array('controller' => 'pages', 'action' => 'display', 'links')); /* /about is a directory so i have an explicit route for index and a wildcard */ Router::connect('/about', array('controller' => 'pages', 'action' => 'display', 'about/index')); Router::connect('/about/*', array('controller' => 'pages', 'action' => 'display', 'about')); I then modified pagesController::display() like: /* Allows for custom actions */ if (method_exists($this, $page)) { $this->$page(); } $this->render(join('/', $path)); This way, I could have many nested directories. I just had to specify the index page for each directory. It wasn't a big deal for that site because there were very few static pages and many controllers. If you plan on adding static pages all the time this might be tedious or prone to mistakes. If I was doing it over again I might approach it differently but this seems to work fine. The current site I'm working on is more CMS-like, with all content in the DB. > Also on an unrelated note, how do I find threads that I previously > made in google groups? Yesterday I made a new post and it took 6 > hours to appear. And to see if it had any replies I have to search > through the Topic list I believe that newbies are moderated for some indeterminate period of time. Also, your posts won't be dsiplayed in your gMail INBOX (as i notice you're using) until someone responds to it. Although, you might be able to find it in the google group web page, I'm not sure. But, as i said, you're probably just being moderated. That will stop after a few posts (unless you irritate Chris ;-) A couple of times, I've sent a post off only to figure out my problem a minute later[1]. I realise that I can just reply to the msg in my SENT folder in order to cancel the cry for help. [1] b.logica's Law of Looking Like a 'Tard Online: No matter how many hours one spends gnashing their teeth over something, there's a better than even chance that the clue train will pull in within 5 minutes of posting a plea for help to a mailing list. The odds rise quickly with the degree to which the solution was a stupidstupidstupid oversight. Double the odds if one's original post explicitly stated that one checked the very damned thing it turned out to be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routes and named params
Router::connect('/musicians', array('controller' => 'requests', 'action' => 'view', 'musician')); // $this->passedArgs[0] == 'musician' Router::connect('/bands', array('controller' => 'requests', 'action' => 'view', 'band')); // $this->passedArgs[0] == 'band' On Sat, May 31, 2008 at 6:00 PM, cronet <[EMAIL PROTECTED]> wrote: > > Hi, > > I want to achieve different URLs map to the same controller with > different named arguments. The named arguments should not appear in > the URL itselfs... > > Examples: > > URL: /musicians > > Mapped to: > RequestsController->view(); > $this->passedArgs['type'] = 'musician'; > > > URL: /bands > > Mapped to: > RequestsController->view(); > $this->passedArgs['type'] = 'band'; > > > Is this possible? > > Regards, > Alexander > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Static pages
Hey I'm just starting to learn cakephp and have a question... I was wondering what the best way to handle static pages and the home page is. This is what I've done: In the routes file I added: Router::connect('/', array('controller' => 'pages')); And I commented out these two lines: //Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); //Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); So now the top directory (the home page) routes to PagesController- >index(); and it uses the view pages/index.ctp Furthermore if I want a static /about page I create the route: Router::connect('/about', array('controller' => 'pages/about')); And now /about routes to PagesController->about(); and uses the view at pages/about.ctp Using this method I have to create a new route for every static page as well as add an event for each static page in the PagesController. Is this the best method or is there a better way? I feel like I just made this way of doing static pages up and it's not the way they are meant to be handled. Also on an unrelated note, how do I find threads that I previously made in google groups? Yesterday I made a new post and it took 6 hours to appear. And to see if it had any replies I have to search through the Topic list Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Menu on a portal
Hi! I am new with CakePHP. I have read the IBM tutorial "How to cook up websites fast". I liked it much. It was much better than the Blog Tutorial. But I miss some parts. I can create views, tables with relations, etc. But if for example I have 10 views on a portal, how can I create a menu so that - it shows on each site next to the corresponding view (for example on the left), - and when I open a view in the browser the corresponding menuitem is highlighted with bold? The main point is that I would not like to paste the whole menu code in each view's ctp file. I would like to eliminate redundancy. (Is there a way for example to have a "menu module" to which I can give parameters?) I am looking for a standard solution. Is there maybe a tutorial that demostrates this technique? Thanks for help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Order By Votes (belongs to relation)
Hi all, I am trying to perform: $order = 'COUNT('Votes.vote_up'); $albums = $this->Album->findAll(null, null, $order); Where `Album` hasMay `Vote`, and `Vote` belongsto `Album`. When I run the above code, I get the following SQL error: -- Query: SELECT `Album`.`id`, `Album`.`user_id`, `Album`.`title`, `Album`.`description`, `Album`.`youtube_url`, `Album`.`deleted`, `Album`.`created`, `Album`.`modified`, `User`.`id`, `User`.`username`, `User`.`password`, `User`.`email`, `User`.`realname`, `User`.`age_range_id`, `User`.`mobile`, `User`.`mlist_warchild`, `User`.`mlist_amnesty`, `User`.`active`, `User`.`is_admin`, `User`.`last_login`, `User`.`created`, `User`.`modified` FROM `albums` AS `Album` LEFT JOIN `users` AS `User` ON (`Album`.`user_id` = `User`.`id`) WHERE 1 = 1 ORDER BY `Votes`.`vote_up` DESC Warning (512): SQL Error: 1054: Unknown column 'Votes.vote_up' in 'order clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 440] -- So it would appear that CakePHP 1.2.0.6311 is not adding Votes to the SQL Query - what am I doing wrong? Thanks jonny. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Image manipulation functions ... in controller, model or component?
On Sat, May 31, 2008 at 1:20 PM, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote: > >> Sure, i can understand having an Image model. I just don't feel that >> it's the correct place for *manipulation* code. > > I think you have to work a bit on your own on the idea of "fat models, > skinny controllers" and think that the models are more than just a way > to query the database. I'm perfectly fine with fat models. However, I don't think *image manipulation code* belongs in a model. The OP asked for opinions; we've both shared ours. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
routes and named params
Hi, I want to achieve different URLs map to the same controller with different named arguments. The named arguments should not appear in the URL itselfs... Examples: URL: /musicians Mapped to: RequestsController->view(); $this->passedArgs['type'] = 'musician'; URL: /bands Mapped to: RequestsController->view(); $this->passedArgs['type'] = 'band'; Is this possible? Regards, Alexander --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: changing language of date helper, better in core or other?
You might like to see this: https://trac.cakephp.org/ticket/4409 On Sat, May 31, 2008 at 1:12 PM, Alessio <[EMAIL PROTECTED]> wrote: > > I need to use the months in italian... > What do you suggest? > Change in core...or just create some helper or bridge...to convert the > array...maybe before of rendering... > In general I don't want to modify the core... > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Different performance between 1.1 and 1.2
"Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering." Not that I'm hinting anything :D On May 30, 12:13 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Thu, May 29, 2008 at 4:56 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > The problem is that it's the same even if debug is off . > > The difference is smaller but Cake 1.1 seems faster than Cake 1.2 > > Ah, you crazy kids and your concerns about the speed of Cake. Back in > my day, we looked at all factors of an application before we started > blaming the code, since the database would inevitably be the > bottleneck unless we had written really shitty code or were actually > doing computationally-intensive work. > > I think the additional features of 1.2 are what make it worth > upgrading from 1.1, and I hate to burst anyone's ego but I doubt your > application will get so much traffic that any alleged speed decrease > from Cake 1.2 will make a difference. Good coding practices go a long > way towards ensuring application speed. > > Performance testing and benchmarking is an art in itself and unless > you use tools specifically dedicated towards those ends (like Xdebug > or Apache Benchmark or Siege ) you are just making shit up. > > Have I used these tools on Cake? No. Why? Because I don't care about > CakePHP's speed. For 99.999% of those who use CakePHP, it is > MTFEIYFTR (More Than Fast Enough If You Follow The Rules). For the > other .001%, either change your code or go with a non-Cake solution. > > This is the "Twitter sucks because of Rails" fallacy. Twitter sucks > because they built a messaging system using tools for building a > content management system. > > So, to get back to your initial question from the beginning of the thread: > > Upgrade to 1.2 because it is light-years ahead of 1.1 in available features. > > Now get off my lawn! > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Image manipulation functions ... in controller, model or component?
> Sure, i can understand having an Image model. I just don't feel that > it's the correct place for *manipulation* code. I think you have to work a bit on your own on the idea of "fat models, skinny controllers" and think that the models are more than just a way to query the database. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to dynamically add fields to model
My suggestion would be to go with your initial idea. It's workable, it'd take some fiddling with the code to make it work correctly however. But you could achieve most of what you'd need with a bit of code in the afterFind method of your model. On May 31, 4:26 pm, spamec <[EMAIL PROTECTED]> wrote: > Something is wrong with my last response.. anyway its a pitty that > there is no real solution for this problem. I reallly thought that its > possible without predefining fields in database in advance. Anyway > thanks for sharing your knowledge. > > Dnia 31 maja 2008 3:18 "b logica" <[EMAIL PROTECTED]> napisał(a): > > > > > This isn't really a CakePHP problem, then. I think you need to rethink > > your database schema. I wouldn't suggest creating one that has table > > columns pop into existence like that. > > > Add these "extra" fields/columns to the clients table with DEFAULT > > NULL and make sure that your model validation rules have allowEmpty = > > true. If you're unsure what other fields (besides the required ones > > you already know about) will be wanted someday, you should probably > > tell your client or boss to spell out their requirements for the > > website pronto. > > > In any case, if, sometime in the future, they decide that they want to > > add a "shirt size" column (for example) to the clients table it's as > > easy as adding a new column to the table with our friend DEFAULT NULL, > > popping the validation rule into the model, and adding the form field > > into the views. > > > On Fri, May 30, 2008 at 7:05 PM, spamec wrote: > > > Hmm, but I dont know how many fields can admin declare. Its not > > > possible, to make it dynamic in such a way (or am I wrong:) ).. > > > Imagine a case: admin have to extend a Client (which already has > > > name,surname,age etc.) with additional fields like street and postal > > > code. Of course, forms should be extended automatically. What then? > > > I'm interested with quite universal solution, because in future I > > > would like to extend more of my models with such behavior.. > > On 30 Maj, 18:31, "b logica" <[EMAIL PROTECTED]> wrote: > > > Why not just create an AdminPage model? Or, keep everything in Page > > but make the other fields DEFAULT NULL in pages table? > > > On Fri, May 30, 2008 at 4:49 AM, spamec <[EMAIL PROTECTED]> wrote: > > > > Hi there, > > > > I came to a problem and I'm really curious how other people manage > > > such things. I have to build an application in which, admin can extend > > > a Page model with additional fields. > > > > My idea is to create: > > > > Tables: > > > - dynamicfields: id, name,type, required,modelname > > > - dynamicfields_values: id, dynamicfield_id, value,created,updated > > > > And know there is problem, because I have to add,edit,delete fields > > > which are dynamic. What is more, I will have to build forms basing on > > > dynamicfields... Do you have some experience with such situations? > > > > Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need a lightbox type app
Nice work Bram. I have built some helpers for Ext... and I really think that with a vast library such as Ext, and others, its probably best to roll your own. Just my .02 though. On May 30, 1:24 am, grigri <[EMAIL PROTECTED]> wrote: > > Try shadowbox: > > >http://mjijackson.com/shadowbox/ > > Wow, that one looks cool. And it can use mootools! > > > I'm hoping cake will go jQuery one day.. > > I'm hoping cake will go cross-framework - like shadowbox and ExtJS > [though with mootools support too] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
changing language of date helper, better in core or other?
I need to use the months in italian... What do you suggest? Change in core...or just create some helper or bridge...to convert the array...maybe before of rendering... In general I don't want to modify the core... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
1.2xx better label or table layout?
I am making my site... What suggestion... I want to know what it is better.. Using the label or using table layout... Helper $form generates a new line..after label... What do you prefer usually, using lable or table...? I know W3c suggests not using tables..,but i think that it is very confortable...tables.. If I want the label and change style every time? Very thanks... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: passing to 1.2.x.x some doubts
Nice Adam,yes I will look through the code in order to understand... I have a lot of stuff 1.1, that i need to convert... I dont know if this is a good or not... But I want to try to get satisfation from learning the 1.2 and to believe that it is better... And I will use $form helper... Interesting also the div... Thanks... On 31 Mag, 17:08, Adam Royle <[EMAIL PROTECTED]> wrote: > All of the form related methods that were in $html are now in $form > (which makes much more sense), but may be named differently. > > You can also do this to remove the div as well. > > $form->input('Model.fieldname', array('label' => false, 'div' => > false)); > > I recommend using the $form->input method on all of your fields unless > you really need to do something unique. You can pretty customise these > quite a lot with the second param. I found looking through the source > code for these methods helped me gain a greater understanding of how > it all fits together. > > Hope that helps, > Adam > > On May 31, 10:41 am, Alessio <[EMAIL PROTECTED]> wrote: > > > Nice, thanks dear, with this , very useful, the label disappar... > > > Only some precisations.. > > > $form->input('Model.fieldname', array('label' => false)); > > > this will generate a div wrapping the input field... > > > If I need only a pure input field... some options ? > > > It is not so graviuos having a Div , but only for precision, I want to > > know... > > > So if YOu want a simple input field without any sort of code: > > > text('name', array('class' => 'required'));?> > > > Another precisation, I am searching to use the old method with the > > html helper, but the form field is not built correctly.. > > > input ('ModelName.descrioption');?> > > where ModelName is my model > > but I get that html is not filled in in according to cake rules (data[] > > []), because i get this: > > > > > without Data[] > > > SO, another problem, if I use manually without helper , when i post > > the form, the field lose the value...and the cake engine doesn t fill > > the value > > > > > > This is a problem for me, if I need use pure code... > > > What I have to do? to refill this manually,,this is enough boring... > > with the power of Cakephp.. > > > Thanks for suggestions... > > > On 31 Mag, 01:48, Adam Royle <[EMAIL PROTECTED]> wrote: > > > > You must change a bit when moving from 1.1 to 1.2, pretty much > > > everything is still in there, just in a different form. > > > > For your form/label issue... try doing this: > > > > echo $form->input('Model.fieldname', array('label' => false)); > > > > Maybe if you work your way through the Cookbook (http:// > > > book.cakephp.org/) or actually look at the source code you will > > > discover more. > > > > Cheers, > > > Adam > > > > On May 31, 4:25 am, Alessio <[EMAIL PROTECTED]> wrote: > > > > > I want to ask some people, if it is a good idea, in general, passing > > > > to new version... > > > > > I want for example to use, some old methods, and Cakephp Engine, often > > > > tells that , this or that is deprecated... > > > > > First Question, I will stress you, often ;)...Very thanks > > > > > Can I use the old helper $html..., I am trying to use it and the field > > > > in the form is not goodly filled in.. > > > > > If I use new helper $form My field is filled in with Label and other > > > > stuff... > > > > > This is good for Css rules, but if I don't want this stuff? > > > > > A little note...Is there a complete reference with example ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bake error
I had same problem I had a "base" cake installation directory and used that in the path environment variable I messed around with it and created a couple apps, then I started to work on a "real" app that I was going to put into production so I create a folder with a the same cake installation files and folders in it, it all runs perfectly fine and I changed the layouts and home page without any problems Then I moved onto creating the models and ran 'cake bake' inside the project's 'app' folder and got the same error message as above. I solved the problem temporarily by resetting the environment variable to point to the project's console directory not sure if everything I did was the correct way of doing things... summary (maybe help you understand my situation): PATH = ";C:\websites\cake\cake\console' Project location: C:\websites\project (I unziped the contents of the zip file in here, without the cakephp1.2.x.x. folder) so I changed PATH: "..;C:\websites\project\cake\console" and it now works On May 22, 11:30 pm, Gwoo <[EMAIL PROTECTED]> wrote: > What are the steps to reproduce theerror? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: calling Related tables from controller
Wow! I knew it should be something that simple! Thank you very much, I can continue my practicing now! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Should I learn cake 1.1 or 1.2?
This is very helpful, thank you. I will start right off with 1.2 then. Thanks! Jonah On May 31, 6:51 am, francky06l <[EMAIL PROTECTED]> wrote: > I would start directly with cake 1.2. It has more functionalities, > embedded tests and more "automagic" features. > A lot of us are already running cake 1.2 in production and the > official release shout be out very soon. > > On May 31, 4:25 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > > I learned the very basics of codeigniter before school started and now > > that school is out I decided to learn cakephp instead. However I just > > realized that there is a 1.1 and 1.2 beta. Which one should I learn? > > It seems that if a learn 1.1, by the time that I finish learning it > > enough to be able to release a website, 1.2 will then be out and I > > will want to learn that one. Which one should I learn? I also noticed > > that they both have separate documentations, which one would be easier > > to learn from? > > > Thanks, > > Jonah --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to dynamically add fields to model
Something is wrong with my last response.. anyway its a pitty that there is no real solution for this problem. I reallly thought that its possible without predefining fields in database in advance. Anyway thanks for sharing your knowledge. Dnia 31 maja 2008 3:18 "b logica" <[EMAIL PROTECTED]> napisał(a): > This isn't really a CakePHP problem, then. I think you need to rethink > your database schema. I wouldn't suggest creating one that has table > columns pop into existence like that. > > Add these "extra" fields/columns to the clients table with DEFAULT > NULL and make sure that your model validation rules have allowEmpty = > true. If you're unsure what other fields (besides the required ones > you already know about) will be wanted someday, you should probably > tell your client or boss to spell out their requirements for the > website pronto. > > In any case, if, sometime in the future, they decide that they want to > add a "shirt size" column (for example) to the clients table it's as > easy as adding a new column to the table with our friend DEFAULT NULL, > popping the validation rule into the model, and adding the form field > into the views. > > On Fri, May 30, 2008 at 7:05 PM, spamec wrote: > > Hmm, but I dont know how many fields can admin declare. Its not > > possible, to make it dynamic in such a way (or am I wrong:) ).. > > Imagine a case: admin have to extend a Client (which already has > > name,surname,age etc.) with additional fields like street and postal > > code. Of course, forms should be extended automatically. What then? > > I'm interested with quite universal solution, because in future I > > would like to extend more of my models with such behavior.. > > On 30 Maj, 18:31, "b logica" <[EMAIL PROTECTED]> wrote: > Why not just create an AdminPage model? Or, keep everything in Page > but make the other fields DEFAULT NULL in pages table? > > On Fri, May 30, 2008 at 4:49 AM, spamec <[EMAIL PROTECTED]> wrote: > > > Hi there, > > > I came to a problem and I'm really curious how other people manage > > such things. I have to build an application in which, admin can extend > > a Page model with additional fields. > > > My idea is to create: > > > Tables: > > - dynamicfields: id, name,type, required,modelname > > - dynamicfields_values: id, dynamicfield_id, value,created,updated > > > And know there is problem, because I have to add,edit,delete fields > > which are dynamic. What is more, I will have to build forms basing on > > dynamicfields... Do you have some experience with such situations? > > > Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Should I learn cake 1.1 or 1.2?
As long as you understand the pros and cons of each, it's really up to you. I personally chose to work with 1.2 and have been using the nightly builds. IMO, the new features outweigh any "lack of documentation" (real or perceived). I believe a 1.2 RC release is expected soon, if that influences your decision any. Bottom line, either version is great and it just comes down to your preference. On May 30, 7:25 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > I learned the very basics of codeigniter before school started and now > that school is out I decided to learn cakephp instead. However I just > realized that there is a 1.1 and 1.2 beta. Which one should I learn? > It seems that if a learn 1.1, by the time that I finish learning it > enough to be able to release a website, 1.2 will then be out and I > will want to learn that one. Which one should I learn? I also noticed > that they both have separate documentations, which one would be easier > to learn from? > > Thanks, > Jonah --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to dynamically add fields to model
Pitty, I really thought there is some method to solve without predefining fields in advance in database. What is more, proposed solution force me to administer such system. Anyway, thanks for sharing your knowledge. This isn't really a CakePHP problem, then. I think you need to rethink your database schema. I wouldn't suggest creating one that has table columns pop into existence like that. Add these "extra" fields/columns to the clients table with DEFAULT NULL and make sure that your model validation rules have allowEmpty = true. If you're unsure what other fields (besides the required ones you already know about) will be wanted someday, you should probably tell your client or boss to spell out their requirements for the website pronto. In any case, if, sometime in the future, they decide that they want to add a "shirt size" column (for example) to the clients table it's as easy as adding a new column to the table with our friend DEFAULT NULL, popping the validation rule into the model, and adding the form field into the views. On Fri, May 30, 2008 at 7:05 PM, spamec <[EMAIL PROTECTED]> wrote: > Hmm, but I dont know how many fields can admin declare. Its not > possible, to make it dynamic in such a way (or am I wrong:) ).. > Imagine a case: admin have to extend a Client (which already has > name,surname,age etc.) with additional fields like street and postal > code. Of course, forms should be extended automatically. What then? > I'm interested with quite universal solution, because in future I > would like to extend more of my models with such behavior.. > > On 30 Maj, 18:31, "b logica" <[EMAIL PROTECTED]> wrote: >> Why not just create an AdminPage model? Or, keep everything in Page >> but make the other fields DEFAULT NULL in pages table? >> >> On Fri, May 30, 2008 at 4:49 AM, spamec <[EMAIL PROTECTED]> wrote: >> >> > Hi there, >> >> > I came to a problem and I'm really curious how other people manage >> > such things. I have to build an application in which, admin can extend >> > a Page model with additional fields. >> >> > My idea is to create: >> >> > Tables: >> > - dynamicfields: id, name,type, required,modelname >> > - dynamicfields_values: id, dynamicfield_id, value,created,updated >> >> > And know there is problem, because I have to add,edit,delete fields >> > which are dynamic. What is more, I will have to build forms basing on >> > dynamicfields... Do you have some experience with such situations? >> >> > Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Ajax request through YUI (Yahoo UI) and Json object back - how to?
This tutorial is for the Ext JS framework but the theory of ajax related info is the same. http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/ Cheers, Adam On May 31, 3:18 pm, Luciano <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have an app that I wrote using Cake and I have a decent > understanding of the Cake principles and techniques. However, I > started to make some of my actions ajax driven and still haven't been > able to successfully complete the process. I red through tons of > posts and tried to glue together bits and pieces of some people who > don't use the built in spriptaculous and use a different library (ie. > jquery) but haven't had much luck making it work. Below is my > scenario: > > JavaScript code (YUI): > > // Make the call to the server for JSON data > YAHOO.util.Connect.asyncRequest('POST','url('/ > organization/join/'.$organization['id']); ?>', callbacks); > > // My callbacks > var callbacks = { > > success : function (o) { > > // Process the JSON data returned from the server > var messages = []; > try { > messages = YAHOO.lang.JSON.parse(o.responseText); > } > catch (x) { > alert("JSON Parse failed!"); > return; > } > > // The returned data was parsed into an array of > objects. > // Do whatever here > > }, > > failure : function (o) { > if (!YAHOO.util.Connect.isCallInProgress(o)) { > alert("Async call failed!"); > } > }, > > timeout : 3000 > } > > Questions: > 1 - What should I have in my beforeFilter() for this controller? > 2 - How do I get the action to return a Json only? > 3 - Do I have to add any .ctp file or modify routes.php? > > I appreciate if someone could provide me with all the things needed to > get a json object back from an AJAX request. > > PS: I am using 1.2 beta, thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: passing to 1.2.x.x some doubts
All of the form related methods that were in $html are now in $form (which makes much more sense), but may be named differently. You can also do this to remove the div as well. $form->input('Model.fieldname', array('label' => false, 'div' => false)); I recommend using the $form->input method on all of your fields unless you really need to do something unique. You can pretty customise these quite a lot with the second param. I found looking through the source code for these methods helped me gain a greater understanding of how it all fits together. Hope that helps, Adam On May 31, 10:41 am, Alessio <[EMAIL PROTECTED]> wrote: > Nice, thanks dear, with this , very useful, the label disappar... > > Only some precisations.. > > $form->input('Model.fieldname', array('label' => false)); > > this will generate a div wrapping the input field... > > If I need only a pure input field... some options ? > > It is not so graviuos having a Div , but only for precision, I want to > know... > > So if YOu want a simple input field without any sort of code: > > text('name', array('class' => 'required'));?> > > Another precisation, I am searching to use the old method with the > html helper, but the form field is not built correctly.. > > input ('ModelName.descrioption');?> > where ModelName is my model > but I get that html is not filled in in according to cake rules (data[] > []), because i get this: > > > without Data[] > > SO, another problem, if I use manually without helper , when i post > the form, the field lose the value...and the cake engine doesn t fill > the value > > > > This is a problem for me, if I need use pure code... > > What I have to do? to refill this manually,,this is enough boring... > with the power of Cakephp.. > > Thanks for suggestions... > > On 31 Mag, 01:48, Adam Royle <[EMAIL PROTECTED]> wrote: > > > You must change a bit when moving from 1.1 to 1.2, pretty much > > everything is still in there, just in a different form. > > > For your form/label issue... try doing this: > > > echo $form->input('Model.fieldname', array('label' => false)); > > > Maybe if you work your way through the Cookbook (http:// > > book.cakephp.org/) or actually look at the source code you will > > discover more. > > > Cheers, > > Adam > > > On May 31, 4:25 am, Alessio <[EMAIL PROTECTED]> wrote: > > > > I want to ask some people, if it is a good idea, in general, passing > > > to new version... > > > > I want for example to use, some old methods, and Cakephp Engine, often > > > tells that , this or that is deprecated... > > > > First Question, I will stress you, often ;)...Very thanks > > > > Can I use the old helper $html..., I am trying to use it and the field > > > in the form is not goodly filled in.. > > > > If I use new helper $form My field is filled in with Label and other > > > stuff... > > > > This is good for Css rules, but if I don't want this stuff? > > > > A little note...Is there a complete reference with example ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Should I learn cake 1.1 or 1.2?
I would start directly with cake 1.2. It has more functionalities, embedded tests and more "automagic" features. A lot of us are already running cake 1.2 in production and the official release shout be out very soon. On May 31, 4:25 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > I learned the very basics of codeigniter before school started and now > that school is out I decided to learn cakephp instead. However I just > realized that there is a 1.1 and 1.2 beta. Which one should I learn? > It seems that if a learn 1.1, by the time that I finish learning it > enough to be able to release a website, 1.2 will then be out and I > will want to learn that one. Which one should I learn? I also noticed > that they both have separate documentations, which one would be easier > to learn from? > > Thanks, > Jonah --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Templating for Shops
On Sat, May 31, 2008 at 5:23 PM, Max <[EMAIL PROTECTED]> wrote: > > Thanks for your e-mail! > Users are expected to be familiar with HTML. This templating thing is > mostly aimed at web developpers. The main goal here is security. I > want to prevent them from executing php code on the server. Users insert stuff like {{latest_deals}} in a file - your code translates it to something like element('latestdeals); ?> and stores in the view files The key being your users never directly edit the views which have PHP - you can maintain a list of {{tags}} and their php equivalents. Anything not in your list is not replaced. Have done it for a client and it works wonderfully HTH Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Templating for Shops
Thanks for your e-mail! Users are expected to be familiar with HTML. This templating thing is mostly aimed at web developpers. The main goal here is security. I want to prevent them from executing php code on the server. Max On May 31, 12:18 am, mbavio <[EMAIL PROTECTED]> wrote: > Your users are going to know html or some programming language? Maybe > you can set up default modules and let your users only choose from > there... > > Cheers, > mbavio > > On May 30, 4:35 am, Max <[EMAIL PROTECTED]> wrote: > > > Hey, I am trying to integrade templating to allow my users to change > > make their own template to use with my e-commerce engine. Now it's > > pretty obivious that I can't just let them run php in views so I am > > wondering what you guys suggest? I know about Smarty and I've used it > > in the past but I am wondering what has been tried with CakePHP and > > works well. > > > Regards, > > Max Deputter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: calling Related tables from controller
try : $this->User->UserType->find('list', array('fields'=>array('UserType.id', 'UserType.user_type'))); hth On May 31, 9:39 am, tyler_durden <[EMAIL PROTECTED]> wrote: > Hello, I'm a newbie with cakephp, I'm very interested on the > framework, but I have a few days stucked on a very simple problem. > > I have a users table, user_types table (administrator, restricted, > etc) and user_statuses table (active, suspended, banned, etc). > > I want to build the add new user form, this is what I've got this far: > > ***MODEL*** > > class User extends AppModel > { > var $name = 'User'; > > var $belongsTo = array( > 'UserType' => array( > 'className'=> 'UserType', > 'foreignKey'=> 'user_type_id' > ), > 'UserStatus' => array( > 'className'=> 'UserStatus', > 'foreignKey'=> 'user_status_id', > 'limit'=> '5' > ) > ); > > } > > / > ***CONTROLLER*** > class UsersController extends AppController > { > var $name = 'Users'; > > var $helpers = array('Form', 'Html', 'Javascript'); > > function add() { > if (!empty($this->data)) { > if ($this->User->save($this->data)) { > $this->flash('New user has been > saved.','/users'); > } > } > /* HERE I TRY TO POPULATE THE DROPDOWN VALUES FOR USER TYPES*/ > $this->UserType->find('list', > array('fields'=>array('UserType.id', > 'UserType.user_type'))); > } > > } > > // > ***VIEW*** > echo $form->create('User'); > echo $form->input('name'); > echo $form->input('last_name'); > echo > $form->select('user_type',array('vendor'=>'vendor','subcontractor'=>'subcontractor','employee'=>'employee'),'subcontractor',null,false); > > echo $form->end('Save Post'); > // > > When I try to load the page i get an error on the line that tries to > populate the user types, this is the msg i get: > > Notice (8): Undefined property: UsersController::$UserType [APP > \controllers\users_controller.php, line 40] > > Code > > } > > $this->UserType->find('list', > array('fields'=>array('UserType.id', 'UserType.user_type'))); > > UsersController::add() - APP\controllers\users_controller.php, line 40 > Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 268 > Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 240 > [main] - APP\webroot\index.php, line 84 > > Fatal error: Call to a member function find() on a non-object in \app > \controllers\users_controller.php on line 40 > > I'm sure this is a very basic task, but i've been unable to find the > solution by myself, what am I doing wrong? > > Thanks a lot! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how come session is gone when it is redirect to https
hi, any suggestion on how to solve this problem. because whenever I redirect to a https connection for payment like from http://www.domain.com/checkout to https://www.domain.com/checkout the session is lost. Thank you On May 31, 5:38 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On Sat, May 31, 2008 at 3:06 PM, robert123 <[EMAIL PROTECTED]> wrote: > > > anyone knows why cakephp session is gone when it is redirect from http > > to https: > > This is not CakePHP specific - http <> https - will happen with anything PHP > > Tarique > > -- > = > Cheesecake-Photoblog:http://cheesecake-photoblog.org > PHP for E-Biz:http://sanisoft.com > = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how come session is gone when it is redirect to https
On Sat, May 31, 2008 at 3:06 PM, robert123 <[EMAIL PROTECTED]> wrote: > > anyone knows why cakephp session is gone when it is redirect from http > to https: This is not CakePHP specific - http <> https - will happen with anything PHP Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how come session is gone when it is redirect to https
anyone knows why cakephp session is gone when it is redirect from http to https: Thank you www.generics.ws www.genericsmed.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
afterFind - help - advice
Hello all, I am in need for some enlightment :) At the moment I have an Image model which is associated with an ImageType model. So an lmage has a image_type_id. In my Image model I'd like to dispatch the images that each query on the model returns based on the image type. I am currently doing it in afterFind model callback but : Since the results that I use in the afterFind callback are of different formats depending on which type of operation I am doing (read, find, find that part of a recursive find ...), I end up branching the logic to make up for the differrent cases like so : if(isset($data['Image']['id'])) {//READ OPERATION else if(isset($data[0]['Image']['id'])) {//FIND OPERATION if(isset($data[0]['Image'][0]['id'])) {//data from an association after find if(isset($data[0]['id'])) {//data from a deep association after find but to be honest I think I am missing something here and that I even can't be sure I am covering all the cases regarding the format of the result array. I am also thinking there is a better way ... So first : Do I make sense at all ? second : any help or insight really appreciated tia thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Xcache support for multiple CakePHP apps per server
Submit a ticket. It sounds like it is worth a more in depth look. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: passing to 1.2.x.x some doubts
Nice, thanks dear, with this , very useful, the label disappar... Only some precisations.. $form->input('Model.fieldname', array('label' => false)); this will generate a div wrapping the input field... If I need only a pure input field... some options ? It is not so graviuos having a Div , but only for precision, I want to know... So if YOu want a simple input field without any sort of code: text('name', array('class' => 'required'));?> Another precisation, I am searching to use the old method with the html helper, but the form field is not built correctly.. input ('ModelName.descrioption');?> where ModelName is my model but I get that html is not filled in in according to cake rules (data[] []), because i get this: without Data[] SO, another problem, if I use manually without helper , when i post the form, the field lose the value...and the cake engine doesn t fill the value This is a problem for me, if I need use pure code... What I have to do? to refill this manually,,this is enough boring... with the power of Cakephp.. Thanks for suggestions... On 31 Mag, 01:48, Adam Royle <[EMAIL PROTECTED]> wrote: > You must change a bit when moving from 1.1 to 1.2, pretty much > everything is still in there, just in a different form. > > For your form/label issue... try doing this: > > echo $form->input('Model.fieldname', array('label' => false)); > > Maybe if you work your way through the Cookbook (http:// > book.cakephp.org/) or actually look at the source code you will > discover more. > > Cheers, > Adam > > On May 31, 4:25 am, Alessio <[EMAIL PROTECTED]> wrote: > > > I want to ask some people, if it is a good idea, in general, passing > > to new version... > > > I want for example to use, some old methods, and Cakephp Engine, often > > tells that , this or that is deprecated... > > > First Question, I will stress you, often ;)...Very thanks > > > Can I use the old helper $html..., I am trying to use it and the field > > in the form is not goodly filled in.. > > > If I use new helper $form My field is filled in with Label and other > > stuff... > > > This is good for Css rules, but if I don't want this stuff? > > > A little note...Is there a complete reference with example ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
calling Related tables from controller
Hello, I'm a newbie with cakephp, I'm very interested on the framework, but I have a few days stucked on a very simple problem. I have a users table, user_types table (administrator, restricted, etc) and user_statuses table (active, suspended, banned, etc). I want to build the add new user form, this is what I've got this far: ***MODEL*** class User extends AppModel { var $name = 'User'; var $belongsTo = array( 'UserType' => array( 'className'=> 'UserType', 'foreignKey'=> 'user_type_id' ), 'UserStatus' => array( 'className'=> 'UserStatus', 'foreignKey'=> 'user_status_id', 'limit'=> '5' ) ); } / ***CONTROLLER*** class UsersController extends AppController { var $name = 'Users'; var $helpers = array('Form', 'Html', 'Javascript'); function add() { if (!empty($this->data)) { if ($this->User->save($this->data)) { $this->flash('New user has been saved.','/users'); } } /* HERE I TRY TO POPULATE THE DROPDOWN VALUES FOR USER TYPES*/ $this->UserType->find('list', array('fields'=>array('UserType.id', 'UserType.user_type'))); } } // ***VIEW*** echo $form->create('User'); echo $form->input('name'); echo $form->input('last_name'); echo $form- >select('user_type',array('vendor'=>'vendor','subcontractor'=>'subcontractor','employee'=>'employee'),'subcontractor',null,false); echo $form->end('Save Post'); // When I try to load the page i get an error on the line that tries to populate the user types, this is the msg i get: Notice (8): Undefined property: UsersController::$UserType [APP \controllers\users_controller.php, line 40] Code } $this->UserType->find('list', array('fields'=>array('UserType.id', 'UserType.user_type'))); UsersController::add() - APP\controllers\users_controller.php, line 40 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 268 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 240 [main] - APP\webroot\index.php, line 84 Fatal error: Call to a member function find() on a non-object in \app \controllers\users_controller.php on line 40 I'm sure this is a very basic task, but i've been unable to find the solution by myself, what am I doing wrong? Thanks a lot! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ajax request through YUI (Yahoo UI) and Json object back - how to?
Hi guys, I have an app that I wrote using Cake and I have a decent understanding of the Cake principles and techniques. However, I started to make some of my actions ajax driven and still haven't been able to successfully complete the process. I red through tons of posts and tried to glue together bits and pieces of some people who don't use the built in spriptaculous and use a different library (ie. jquery) but haven't had much luck making it work. Below is my scenario: JavaScript code (YUI): // Make the call to the server for JSON data YAHOO.util.Connect.asyncRequest('POST','url('/ organization/join/'.$organization['id']); ?>', callbacks); // My callbacks var callbacks = { success : function (o) { // Process the JSON data returned from the server var messages = []; try { messages = YAHOO.lang.JSON.parse(o.responseText); } catch (x) { alert("JSON Parse failed!"); return; } // The returned data was parsed into an array of objects. // Do whatever here }, failure : function (o) { if (!YAHOO.util.Connect.isCallInProgress(o)) { alert("Async call failed!"); } }, timeout : 3000 } Questions: 1 - What should I have in my beforeFilter() for this controller? 2 - How do I get the action to return a Json only? 3 - Do I have to add any .ctp file or modify routes.php? I appreciate if someone could provide me with all the things needed to get a json object back from an AJAX request. PS: I am using 1.2 beta, thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Correct way to add code to static pages
Thank you! I guess a helper is what I needed. On 30 mayo, 19:16, francky06l <[EMAIL PROTECTED]> wrote: > > I want to know what is the correct way to add PHP to static pages (the > > ones that live in views/pages). I want to use a function across many > > pages. > > Probably in an helper. > > > > > I also want to render an element in my home page, but I don't know > > where I should put the code to set the element's variables. > > in pagesController, you can use $this->set(...) > in the views: $this->renderElement('name', array('var' => 'values')); > > it does not differ much from other pages, unless I misunderstood the > question ... > > hth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Should I learn cake 1.1 or 1.2?
I learned the very basics of codeigniter before school started and now that school is out I decided to learn cakephp instead. However I just realized that there is a 1.1 and 1.2 beta. Which one should I learn? It seems that if a learn 1.1, by the time that I finish learning it enough to be able to release a website, 1.2 will then be out and I will want to learn that one. Which one should I learn? I also noticed that they both have separate documentations, which one would be easier to learn from? Thanks, Jonah --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---