Re: How much to charge?
Thanks for the input, everyone! @euromark - I know it's a very open-ended question, but I didn't even know where to start. I'm probably going to do this in cake, though, and I know there are a lot of developers on this list, so that's why I asked. @Jeremy, Krissy - Thanks! @Tarique - Very nice :-) @keymaster - Thanks for the hourly pricing. That helps a lot! hydra12 On Feb 17, 12:39 am, keymaster wrote: > Just off the top of my head, for freelance work: > > Western countries - $50 - $125/hr. > India/Russia/Africa - $8 - $25/hr. > > Where you fit in that range is determined by a host of issues which > you need to objectively decide for yourself. -- 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
How much to charge?
I've been offered a one-time job to develop a database driven form for someone's website. I don't have any idea what to charge. I've done some of this before, but always when I was on salary. Anybody want to give me some advice? Thanks in advance! hydra12 -- 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
Plugin model with no table
I'm creating a plugin with a model that doesn't use a table. My model looks like this: In spite of having $useTable = false, I get a missing table error for my model. Does anybody know what I'm doing wrong? Error: Database table adauthusers for model Adauthuser was not found. Thanks! hydra12 --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do I represent a habtm where the join table has extra information?
Take a look here: http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM. Look especially at the 'with' key when you define your HABTM relationship. It says in the docs: with: Defines the name of the model for the join table. By default CakePHP will auto-create a model for you. Using the example above it would be called RecipesTag. By using this key you can override this default name. The join table model can be used just like any "regular" model to access the join table directly. If you define your with field, you should be able to use your join table just like you would any other table. On Nov 4, 8:10 am, Anupom <[EMAIL PROTECTED]> wrote: > I think having a separate model for your join table is okay in this case. > And perhaps it's a must as you have a third foreign key involved in that > join table. > > On Tue, Nov 4, 2008 at 6:00 PM, Adriano Varoli Piazza <[EMAIL > PROTECTED]>wrote: > > > > > > > I'm developing an app where I have two tables, let's call them items > > and people, where the relationship between them is HABTM. Plus, the > > individual relationships have extra info: this person is related to > > this item with a 'description' field. > > E.g.: > > > > > people: > > id > > other fields > > > > items: > > id > > other fields > > > > items_people: > > id > > person_id > > item_id > > description (varchar) > > > > > In the 'worst' case, the join table holds another foreign key to a > > table which holds extra info: > > > > items_people_bis: > > id > > person_id > > item_id > > concept_id > > --- > > concepts: > > id > > other fields > > --- > > > Now, I know this is convoluted, but I wanted to know which is the best > > way / standard practice to represent such a thing in cake? I've tried > > with a simple habtm association in the model, seen that I could use > > 'with', also tried using hasmany on both models involved, and making > > an extra model for the join table, but I'm still not sure about how to > > go. I'd appreciate any help. > > > Thanks in advance > > Adriano > > -- > Anupom Syamhttp://syamantics.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: Authentificate against LDAP?
There are some articles in the bakery about using ldap as a model. I haven't used them, so I couldn't say how well they work. I do know that ActiveDirectory is microsoft's version of ldap and doesn't always work quite the way you think it should. Personally, I use adLdap (http://adldap.sourceforge.net/). I drop it in the vendors folder, then create an instance of adldap in my users controller and do all my authentication there. I've had good luck with it so far, but it's not 'cakey', so it might not be what you are looking for. I hope that helps. hydra12 On Nov 4, 4:11 am, Sebastian Göttschkes <[EMAIL PROTECTED] e.de> wrote: > Hi, > > I started using cakePHP not long ago and it's really nice. It works > great for me and my time and effort building web apps has decreased. > Thank you for this! > > Right now I got this problem: I need to authentificate not against a > database but against a LDAP (Active Directory). > > In the database I got a table employees, containing all employees with > their login name (not the password) and other data. When a employee is > sending his login name and password, I want to authentificate him > against the LDAP. If the password is correct AND his dataset is found > in the table (using his login name), the login was correct and he can > use the application. > > Is their an easy way to handle this task with cakePHP? I have searched > the docs but only found the "normal" authentification against a > database. This is not possible as there is no way for me to read the > password from the LDAP into the database. I read something about > models representing LDAP entries, but didn't found any information on > that. > > I hope you guys can help me! > > Regards, > Sebastian --~--~-~--~~~---~--~~ 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 use our own class in cakephp?
Are you talking about a non-cake class that you want to use? If so, drop it in vendors and use it that way. On Oct 23, 5:36 am, xelios <[EMAIL PROTECTED]> wrote: > how to use our own class in cakephp? --~--~-~--~~~---~--~~ 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 edit multple rows in one view
I'd recommend jquery instead of cake's ajax (personal preference, but I think jquery is easier to understand than prototype). Be careful setting all the grades to 0. I don't know your exact situation, but at the school where I work we give parents the ability to see their student's grades online. Parents get really grumpy when their kids have a bunch of 0's for no apparent reason . . . I've been playing with a similar concept. I'm assuming that you have a students table, and each student has many assignments, but also each assignment has many students (you could also do a hasAndBelongsToMany). When the teacher adds an assignment, you could loop through the students and add the assignment to each student with a null or blank grade. Now, you can look at a grid of grades (columns for assignments, rows for students). I'd use the jquery editable plugin or something like it. It works like this - you click on a grade, add the grade, and it calls a cake action via jquery to update that specific assignment grade for that specific student. On Oct 20, 6:46 pm, teknoid <[EMAIL PROTECTED]> wrote: > To save multiple records or multiple related models you can use > saveAll(). > > On Oct 20, 7:04 pm, "soldier.coder" <[EMAIL PROTECTED]> > wrote: > > > On Oct 20, 3:49 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > > I asked about ajax because that actually makes things easier in some > > > ways. You can set each grade to save via ajax when the teacher moves > > > on to the next grade. It all happens transparently in the background, > > > so no looping through the data. > > > That's pretty hot, actually. Maybe I could add something to the code > > that sets up weights that fills grades for categories with 0's so that > > all changes to the grades would be edits, and then use ajax for the > > grade edits. > > > Looks like I need to learn about cake's implementation of ajax. > > > Thanks for your insights. --~--~-~--~~~---~--~~ 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 edit multple rows in one view
There isn't any built-in functionality. When you submit your data, debug $this->data to see what was sent in. Then do loop through the data and save each grade individually. Here's the catch - you have to set the id to null each time you save a new row, or each new row will overwrite the last one. Editing is a different ballgame. Then you just have to make sure you are using the correct id for each grade. I asked about ajax because that actually makes things easier in some ways. You can set each grade to save via ajax when the teacher moves on to the next grade. It all happens transparently in the background, so no looping through the data. On Oct 20, 2:40 pm, "soldier.coder" <[EMAIL PROTECTED]> wrote: > This doesn't have to be ajax or have any fancy transitions. Just a > save button would be fine. I guess more than anything I am asking is > there any built-in facility for saving more than one record at a time? > > Investigation into the grades_controller reveals > if (!empty($this->data) { > $this->Grade->save($this->data); > > so based on that and given the grades array, can i just iterate over > the array and change $this->data and then call > $this->Grade->save($this->data); > ?? > > On Oct 20, 1:47 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > This can get complicated VERY fast. First, do you want the changes to > > be made immediately, or does the teacher have to click a submit/save > > button to save changes? Second, is ajax an option? > > > hydra12 > > > On Oct 20, 10:27 am, "soldier.coder" > > > <[EMAIL PROTECTED]> wrote: > > > Hello coders! > > > > I'm trying to build a nice gradebook app, so teachers can keep of > > > students grades. > > > Right now, scaffolding has given me enough to enter one grade for one > > > grade category for one student. > > > > The way my code is set up, teachers choose categories (like writing > > > assignments, oral presentations, lab assignments, etc), then decide a > > > weight for those categories, then decide a number of assignments for > > > those categories. This is all set up so teachers can figure out > > > current and final grades which can either be emailed to the individual > > > students or they can login to the website and see their grades. > > > > Anyway, I'd like to set up a teacher view that lets them do mass input > > > of grades. So after logging in, and picking the class they want to > > > work on, it should show a table (for editing) with one student per > > > row and then grades for each category across the rows > > > > Can someone please point me toward how to set that sort of thing up? --~--~-~--~~~---~--~~ 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 edit multple rows in one view
This can get complicated VERY fast. First, do you want the changes to be made immediately, or does the teacher have to click a submit/save button to save changes? Second, is ajax an option? hydra12 On Oct 20, 10:27 am, "soldier.coder" <[EMAIL PROTECTED]> wrote: > Hello coders! > > I'm trying to build a nice gradebook app, so teachers can keep of > students grades. > Right now, scaffolding has given me enough to enter one grade for one > grade category for one student. > > The way my code is set up, teachers choose categories (like writing > assignments, oral presentations, lab assignments, etc), then decide a > weight for those categories, then decide a number of assignments for > those categories. This is all set up so teachers can figure out > current and final grades which can either be emailed to the individual > students or they can login to the website and see their grades. > > Anyway, I'd like to set up a teacher view that lets them do mass input > of grades. So after logging in, and picking the class they want to > work on, it should show a table (for editing) with one student per > row and then grades for each category across the rows > > Can someone please point me toward how to set that sort of thing up? --~--~-~--~~~---~--~~ 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: Foreach loop with data from other model
If you have the relationship setup correctly, you don't have to use the ratings model. You can do this in your controller: $this->set('ratings', $this->Picture->Rating->avgRating($id)); That's all off the top of my head, but it should work. HTH, hydra12 On Oct 17, 4:22 pm, nomex <[EMAIL PROTECTED]> wrote: > Hey, > > I have 2 Tables: > > pictures > ratings > > every rating belongs to a picture and every picture has many ratings. > (just a normal rating DB) > > i want to make a list of every picture with it's average rating in the > picture view. Therefor i had made a avgRating function (gets the id of > the picture and returns the avg. Rating) in the model of the rating > and used "uses (picture, rating)" in the picture controller. But i'm > not able get the data into the controller and the view. > > can anyone pls help me? > > thank you very much! --~--~-~--~~~---~--~~ 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: Adding fields to the URL
Assuming that you have a controller called contents (pages is already taken by Cake) and a view action that lets you view a given page, you could try something like this: http://www.testsite.com/contents/view/1/secretid/ In your controller, you could have this: function edit($id=null, $secretid=null) Now when someone goes to a page, you check first for the id to make sure the id exists (standard procedure). If the id exists, read that record from the database. Now check that record's secretid against $secretid from the url. If they don't match, or if none was supplied (ie. it gets assigned to null if they don't put one in the url), render a view page. If they do match, show an edit page (you could do this through switching, or you could redirect to an edit page). I hope that helps! hydra12 On Oct 15, 5:23 am, Cody Sortore <[EMAIL PROTECTED]> wrote: > Okay, with the particular site I'm building I did a poll and received > 80% feedback to make the site without a user log in system. The > problem is that I want to allow the creator editing access still. > People make mistakes, or may need to delete spam comments > occasionally. > > What I was thinking was to have a place when creating their page they > put in a "secret id" that then goes into the database and what I want > to do is so that the only way to access the edit page is to have that > secret id in the url for example: > > http://www.testsite.com/pages/secretid/edit/1/ > > I want to set it up so that the only way to edit the page would be to > have the secret id in place... I can't figure it out at all though. I > did consider making it so that instead of the page number it just used > the secret id, but that would be a bad idea because if two people had > the same secret id which would it pull up? And if I checked for > unique id's it would have to be pretty long so that everyone could > have something different. > > Any help or pointing in the right direction would be greatly > appreciated! Thanks in advance for the 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 -~--~~~~--~~--~--~---
Re: 2 apps, one cms and the other is the normal site -> site needs to get to the cms's webroot
I don't have access to my dev machine right now to check, but I think you can do this in the bootstrap file. I'll see if I can find more tomorrow. On Oct 14, 6:14 pm, Shackadoodl <[EMAIL PROTECTED]> wrote: > Hi guys, > > Urgent question: > > I have a project with an extremely tight deadline, so rebuilding it > all is out of the question. > > The problem is, that i have developped a cms ( which works just fine ) > next to the app folder. The structure looks like this > > -root > --app > --cms -> just a renamed copy off the app folder with the cms built > into it > --cake > --vendors > > now when i access the cms throughwww.mysite.com/cmsit works just > great, but the problem is that i need to build the frontend itself, > and since the cms has all the images etc in its webroot, i cant get to > them with the normal site. > > Is there any way that i can tell the app to look into the cms webroot > folder as well or just go get its files there? Because the minute i > mess with the advanced installation or with the htaccess files the > normal site fubars. > > Can anyone help me? > > Best Regards > Shackadoodl --~--~-~--~~~---~--~~ 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: CakePHP Install Problem
It really sounds like a permissions problem. I know you checked it already, but does the user that apache runs as have permissions to view the page? On Oct 9, 11:08 am, darwin2kx <[EMAIL PROTECTED]> wrote: > No file permission problems. > AllowOverride is set to All. --~--~-~--~~~---~--~~ 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: Share the webroot folder ( multiple app folders )
Have you looked at the advanced install options in the documentation? http://book.cakephp.org/view/35/Advanced-Installation You can define where the webroot folder, the app folder, and the cake folder are. On Oct 7, 2:15 pm, Shackadoodl <[EMAIL PROTECTED]> wrote: > Hi guys > > I've seen the wildflower cms posted recently on the site, and it dit > one thing that i have been trying to do for a long time with cake: > have a seperate app folder ( named wildflower in this case ), and let > it connect to the webroot folder in the normal app folder. > > When i was in spain I was trying to make a cms, but since i couldn't > figure out how this was done I had to abandon the idea and build in a > cms using admin routing. > > So my questions are: > 1- how to i make a seperate app folder connect to the main app > folders' webroot? > 2- how to i redirect /admin to this other app folder? > > I've been searching the docs, googling, and even after a month I still > haven'th found it. Maybe the info I need doesn't exist, or else I've > been looking in the wrong way all the time. > > Can somebody point me in the right direction? > > Best regards > Gregory --~--~-~--~~~---~--~~ 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: Trouble with the HtmlHelper and $scripts_for_layout
Oops! You're right. Sorry. I can't get it to work either. On Oct 6, 2:00 pm, "Marc Campeau" <[EMAIL PROTECTED]> wrote: > Thanks for your input. > > I beg to differ though, the manual says: > > http://manual.cakephp.org/view/96/Layouts > When using $html->css() or $javascript->link() in view files, specify > 'false' for the 'in-line' argument to place the html source in > $scripts_for_layout. (See API for more details on usage). > > http://manual.cakephp.org/view/206/Inserting-Well-Formatted-elements > css(mixed $path, string $rel = null, array $htmlAttributes, boolean > $inline = true) > > Creates a link(s) to a CSS style-sheet. If $inline is set to false, > the link tags are added to the $scripts_for_layout variable which you > can print inside the head tag of the document. > > http://api.cakephp.org/class_html_helper.html > HtmlHelper::css($path, $rel = null, $htmlAttributes = array(), $inline = true) > > Creates a link element for CSS stylesheets. > > Parameters: > mixed $path The name of a CSS style sheet in /app/webroot/css, > or an array containing names of CSS stylesheets in that directory. > string $rel Rel attribute. Defaults to "stylesheet". > array $htmlAttributes Array of HTML attributes. > boolean $inline If set to false, the generated tag appears in > the head tag of the layout. > > http://api.cakephp.org/class_javascript_helper.html > JavascriptHelper::link( $url, $inline = true) > > Returns a JavaScript include tag (SCRIPT element). If the filename is > prefixed with "/", the path will be relative to the base path of your > application. Otherwise, the path will be relative to your JavaScript > path, usually webroot/js. > > Parameters: > mixed $url String URL to JavaScript file, or an array of URLs. > boolean $inline If true, the
Re: Trouble with the HtmlHelper and $scripts_for_layout
If you look at the api, you'll see that $html->css creates a link to a pre-existing style sheet in webroot/css. $scripts_for_layout is for javascript using the javascript helper. On Oct 6, 12:02 pm, Marc Campeau <[EMAIL PROTECTED]> wrote: > Yeah sorry, I thought I should have put that in the message. > > I'm running off the latest code from the SVN Repository, checked it > out last week, Friday if I remember well. > > Thanks for the heads up, > > Marc > > On Oct 6, 12:52 pm, "Lamonte(Scheols/Demonic)" <[EMAIL PROTECTED]> > wrote: > > > Just to help others who might help you, are you running the latest version > > of Cake? > > > On Mon, Oct 6, 2008 at 10:34 AM, Marc Campeau <[EMAIL PROTECTED]> wrote: > > > > Hi everyone, > > > > I'm having trouble with the HtmlHelper and the $scripts_for layout. > > > Basically, I use the helper to add CSS inline ($html- > > > >css(array('someCss'), null, null, false);) from within the different > > > elements (/views/elements/) that the view needs to render. I would > > > have expected these CSS to show up in the HTML Head by echoing > > > $scripts_for_layout in default.ctp but unfortunately they don't? If I > > > echo the CSS inline then they do show up in the markup. > > > > Anyone knows what I'm doing wrong? > > > > Side notes: > > > Doing the $html->css() inline call from /views/default.ctp doesn't > > > work either. > > > Doing the $html->css() inline call from the view that's rendered (/ > > > views/users/login.ctp for instance), works. > > > > Thanks for taking the time to read this, > > > > Marc > > > -- > > Join cleanscript.com Come here for professional PHP coding. --~--~-~--~~~---~--~~ 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 can I change the path of webroot/js and webroot/css?
This is configured in /cake/cake/config/paths.php. I don't know if there is a way to configure this on a per app basis or not. You'll have to be careful, though. It's configured in 2 different places - once for the absolute path, and once for the web path. On Sep 18, 9:27 am, MarcS <[EMAIL PROTECTED]> wrote: > I've been trying to locate this in the cookbook but I couldn't find > it. > > Is there a way to configure cake to change the default paths for the > js and css directories inside the webroot dir? > > thanks, > Marc --~--~-~--~~~---~--~~ 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: Populating a selectTag using jQuery AJAX
In your controller, you need to $this->set('xml',$xml); Set the layout to be blank (1.2 has an ajax layout that would work for this, but I don't know if 1.1 does or not). You need a view called get_events that does this: Your jquery is calling Attendance/get_events, so there has to be a view called get_events that returns the xml data. I hope that helps. hydra12 On Sep 17, 8:57 pm, teknoid <[EMAIL PROTECTED]> wrote: > Perhaps I didn't look at your code very closely, but after you've > made the xml string ($xml) what happens? Shouldn't your action output > (return) that xml? > I'm not sure if 1.1 has the ability to use RequestHandler to respond > as xml, otherwise you could just make an empty layout, which would > only display your xml data (or more specifically return your xml data > back to jquery). > > p.s. do you really need 'onchange' in your select tag? I'm pretty sure > with jquery you can "listen" for an event on a given element. > > On Sep 17, 8:34 pm, peterhf <[EMAIL PROTECTED]> wrote: > > > Using: > > CakePHP 1.1.19.6305 > > jquery-1.2.6.min.js > > > In the view: > > > select a > > campaign: selectTag( > > 'Campaign/CampaignID', $options_C, null, array( 'onchange' > > > => 'display_select_event()','id' => 'select_campaign' ), null, true, > > false ); ?> > > > In the JavaScript: > > > function display_select_event() > > { > > . > > . > > . > > // get the events for this campaign. > > $.get( 'Attendance/get_events', { campaign_id: selected_index }, > > function( xml ) { alert( xml ); }, 'XML' ); > > . > > . > > . > > > } > > > In the controller: > > > function get_events( $campaign_id ) > > { > > $conditions = array( 'CampaignID' => $campaign_id ); > > $fields = array( 'CEventID', 'Name' ); > > $result = $this->Event->findAll( $conditions, $fields, null, null, > > 1, null ); > > > if( count( $result ) ) > > { > > $xml = ''; > > > foreach( $result as $key => $value ) > > { > > foreach( $value as $id => $name ) > > $xml .= ''; > > $xml .= '' . $value['Event']['CEventID'] . ''; > > $xml .= '' . $value['Event']['Name'] . ''; > > $xml .= ''; > > } > > } > > else > > { > > // What if there are no events for this campaign. > > } > > } > > > The function, get_events(), produces the correct, well-formed XML > > document. But Cake is complaining about the missing view for > > "get_event" and the jQuery is not returning the XML document produced > > by get_events(). > > > A link to an example of what I am trying to do would be sufficient and > > greatly appreciated but if you spot the errors in my code that would > > be appreciated also. > > > Peter - --~--~-~--~~~---~--~~ 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: JSON troubles
I've had this problem developing on my macbook using mamp. I finally stopped using mamp and started using the builtin apache server, and I haven't had any more problems. On Sep 9, 11:44 am, Kyle Decot <[EMAIL PROTECTED]> wrote: > Okay that is getting more and more strange as I keep trying to get it > working. If I am athttp://localhost/and I try to > accesshttp://localhost/pages/list.json?state_id=6 then I get the 404 page. > However if I am athttp://192.168.2.4/(which is the same site) and > try to accesshttp://localhost/then the json array comes through but > it tells me there is a parse error. it looks like: > > {"Results":[{"name":"The Flow Skatepark"}]} > > I'm not sure what's wrong with it but it looks like maybe there is a > space at the beginning. > > Any Idea why I would receive a 404 or json array depending on which > url I'm on? I find this to be very aggravating. Thanks for any ideas. --~--~-~--~~~---~--~~ 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: JQuery + JSON
It's been awhile since I tried this, and I'm not in a position to test this code, but I think you can do something like this: Make sure to include these 2 lines in your controller: Configure::write('debug', '0'); //set debug to 0 for this function because debugging info breaks the XMLHttpRequest $this->layout = "ajax"; In your view, include this: Object($post).'}'; ?> The syntax is very important here if you want true json format. Now, in your javascript, change this line: var postUrl = 'posts/view/post.json?='+postId+''; to this: var postUrl = 'posts/view/'+postId+''; Now, if you call your page directly, say like this: http://localhost/myapp/posts/view/post, you should get a blank page, but the json should show up in firebug. If you call it via ajax, everything should work. HTH, hydra12 On Sep 7, 11:43 am, Jonathan <[EMAIL PROTECTED]> wrote: > I'm still having trouble with this. Any ideas? > > On Aug 27, 8:36 am, Jonathan <[EMAIL PROTECTED]> wrote: > > > I did this http://www.pagebakers.nl/2007/06/05/using-json-in- > > cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers > > blog to get JSON working with my installation of CakePHP. > > > Almost everything seems to be working fine. When I go > > tohttp://localhost/mkb/index > > I get the page like normal and when I go to index.json I get a > > download dialog. I'm getting my JSON headers when I make a call > > withJQueryas well so it seems to be sending the JSON right. > > > The problem is when I tried to get content with the JSON. I can't get > > it to give me any content, only the headers. > > > Here's my javascript: > > > $(document).ready(function() { > > $('.post').click(function(event) { > > event.preventDefault(); > > var postId = $(this).children('.id').text(); > > var postUrl = 'posts/view/post.json?='+postId+''; > > //inject a DIV container after the clicked title > > $(this).append(''); > > > $.getJSON(postUrl, function(data) { > > $('div[class="postContent > > post'+postId+'"]').append(data); > > }); > > > //hide the post content of titles that do not have that > > same id as > > the one clicked. > > $('.post').filter(function() { > > return $(this).children('.id').text() != postId; > > }).children('.postContent').css('display', 'none'); > > }); > > > }); > > > Here's the headers I get back: > > Response Headers > > Date Wed, 27 Aug 2008 12:35:14 GMT > > Server Apache/2.2.8 (Win32) PHP/5.2.6 > > X-Powered-By PHP/5.2.6 > > P3P CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" > > Set-Cookie CAKEPHP=deleted; expires=Tue, 28-Aug-2007 12:35:14 GMT; > > path=/mkb CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb > > CAKEPHP=49d5o6b48nf83q8q12lle0pt41; path=/mkb > > CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb > > Content-Length 2 > > Keep-Alive timeout=5, max=100 > > Connection Keep-Alive > > Content-Type text/x-json; charset=UTF-8 > > Request Headers > > Host localhost > > User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) > > Gecko/2008070208 Firefox/3.0.1 > > Accept application/json, text/javascript, */* > > Accept-Language en-us,en;q=0.5 > > Accept-Encoding gzip,deflate > > Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 > > Keep-Alive 300 > > Connection keep-alive > > X-Requested-With XMLHttpRequest > > Refererhttp://localhost/mkb/ > > Cookie CAKEPHP=49d5o6b48nf83q8q12lle0pt41; > > CAKEPHP=02sc14jclvued57ghlaprj0j11 > > > Here's the View in the app: > > > echo $javascript->object($post); > > ?> > > > Any help would be awesome! > > > Thanks Guys. --~--~-~--~~~---~--~~ 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: scaffold
The easiest way to do this is to bake your application and have bake create the default views for you. Then you can go in and edit those views any way you want. Otherwise, scaffolding is pretty much non- editable. I think you can edit the scaffold templates, but I don't know how to do that. On Sep 2, 4:02 am, "Ranjana Sriavastava" <[EMAIL PROTECTED]> wrote: > Hello > > I want remove some fields from scaffold views. which type that possible pls > help me. > > thanks > > Ranjana --~--~-~--~~~---~--~~ 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: JSON troubles
I'm still curious - in your first post, you use a param in the url called id. It equals 6. You said it worked. In your jquery code, you use state_id=6 instead of id=6. Could that be the problem, or is it a typo? --~--~-~--~~~---~--~~ 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: JSON troubles
OK, I missed where the line wrapped, too. A couple of things: 1. In the working link, you have a parameter called id. In the non- working one, you have state_id. 2. Why are you calling the html helper in your javascript? Are you using cake 1.1? 1.2 doesn't have $html->url. 3. If you do mean to use $html->url, I think you are calling it wrong. url takes a cake url ('/mycontroller/mymethod') and turns it into a url ('http://localhost/mycontroller/mymethod'); 4. When you view the javascript source for your page, what url is jquery actually calling? What I mean is, when you view your page and do a view source, what is the final url that is actually being called by ajax? I'm guessing that it's either wrong or has some kind of formatting error. On Aug 25, 12:02 pm, Kyle Decot <[EMAIL PROTECTED]> wrote: > Well I must say that was a stupid mistake on my part but I updated my > code to include the correct URL and still the same thing is happening. > Any ideas ? --~--~-~--~~~---~--~~ 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: JSON troubles
> If I directly navigate tohttp://localhost/pages/list.json?id=6 then the array > will show up no > problem. might help. > > > > $("#states-dropdown").change(function() { > > $.getJSON("<?php echo $html->url("<a rel="nofollow" href="http://localhost/pages/list"">http://localhost/pages/list"</a>;); ? > > >.json?state_id=" + this.value + "",function(data){alert(data);}); > }); > > The address you are going to directly is not the same as the address in your jquery code. http://localhost/pages/list.json?id=6 works, but you get a 404 when you call http://localhost/pages/list. I'd try changing the url in my jquery code to match the url that works when I call it directly. I hope that helps! hydra12 --~--~-~--~~~---~--~~ 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: Slow...
Are you using firebug in firefox? I've noticed that sites with lots of javascript run VERY slow under firebug. Try testing in another browser or turning firebug off and see if that helps. On Apr 24, 9:32 am, Pierre MARCOURT <[EMAIL PROTECTED]> wrote: > Thanks for the advice Chris, > > I am going to try jQuery and see if it is better. > > Chris Hartjes a écrit : > > > > > On Thu, Apr 24, 2008 at 10:22 AM, Pierre MARCOURT > > <[EMAIL PROTECTED]> wrote: > > >> I am doing some queries in beforeRender() because I have to set variables > >> in the layout. > >> When users Log In in my system, they can change the order of the elements > >> (little calendar, etc.) of the layout. > >> And then I save this order in the database. > > > I understand...unavoidable I guess. > > >> So I am using the beforeRender() function to set the order of the elements > >> in the layout when the user load a page. > > >> For the JavaScript part, what I can do ? I have only 2 links : > >> link('prototype') ?> > >> link('scriptaculous') ?> > >> and I am using them with drag & drop, InPlaceEditor, etc. > > > I'd stop using the built-in helpers and use jQuery. > > -- > Pierre > > [EMAIL PROTECTED] > _ > > CableOrganizer.com > 5610 NW 12th Ave, suite 214 > Ft.Lauderdale, FL 33309 > Phone: 954-861-6310 --~--~-~--~~~---~--~~ 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: CakePHP with ExtJS
I've used extjs with cake, too. It's not exactly easy (there aren't a lot of resources for integrating the two), but it can be done. The trick is that cake wants things done a certain way, and you have to figure out how to get extjs to play nice in a cakey kind of way (forms, for instance). I've written a few tutorials on my blog: www.ntatd.org/mark. I don't use any helpers. I hope that helps some! hydra12 On Apr 18, 6:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > ExtJS and Cake do indeed work quite nicely together. Having used them > together for several projects now, I have started working on a > component and a helper to try and produce some of the more common Ext > bits in a sort of scaffolded automagic way. The main things I see the > helper helping with would be Ext forms (based on the form helper) and > things like stores (who wants to re-type all those field: properties > and grid column models when you already have the schema in the cake > model? I also have a view which I use to return data to the > JsonReader, which does things like handle the totalProperty column > integrated with Cake's pager. I'm thinking it might be worth batching > some stuff into a component which intercepts scafolding stuff, so you > can effectively use your cake scafolded controllers with an all ext > frontend and save implementing any crud actions. > > This is coming along nicely, but I'm not quite ready to release it to > everyone just yet. As soon as I have something worth contributing, I > will GPL it and put it up on the ext forums, and the bakery if they'll > have it. > > Just some ideas. They'll be backed up with code shortly. > > Simonhttp://www.simonellistonball.com/ > > On Apr 18, 12:39 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > > > Works very well - just finishing a fairly large project with it but there > > are no helpers and perhaps you are better off that way > > > T > > > On Fri, Apr 18, 2008 at 1:18 PM, inma <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm interested to know how many people are using ExtJS with CakePHP. > > > -- > > = > > 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 "Cake PHP" 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: Array in PHP to JSON
Check out this slide presentation: http://www.thinkingphp.org/2008/02/26/with-jquery-cakephp-to-world-domination-slides/ On slide 31, it gives you a function for your app controller called setJson. On slide 32, it shows how to use setJson in your controller. On slide 33, it shows the code to put in your layout to make your json available to your views. And on slide 34, it shows how to access that data from jquery. I hope that helps. hydra12 On Apr 3, 8:42 am, Tom <[EMAIL PROTECTED]> wrote: > Thanx, but i would like to use it with Jquery. > I have a filled array in php, and in a js file i've got : > > jQuery(document).ready( > function() > { > var lastsel; > > jQuery("#list2").jqGrid( > { > url:'/comms/grid', > datatype: "json", > colNames:['!','Auteur', 'Personne', 'Fonction', 'Raccourci'], > colModel:[ {name:'!', width:120, editable: true, edittype: > "select", > editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}}, > > > // Here i would like to change the values by my array. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 multiple cakephp Apps??
Put your cake folder in your root web folder (ex. http://localhost/). Now put your apps in the cake folder (same folder that the default app is). You can now call them with http://localhost/app1, http://localhost/app2, etc. hydra12 On Jan 26, 1:13 pm, Asinox <[EMAIL PROTECTED]> wrote: > Hi, im newbie with cakephp, and i need to develop a new website but, i > wanna to jump to develop with framework. > > well, i need to know how setup Multiple website with ONE cakephp in my > test server.? > > im trying with: www_root/cake/app > www_root/cake/second_app > > but when i try to see the localhost/second_app i got error about the > controller : You are seeing this error because controller > PostController could not be found. > > what i need to setup before? > second_app is a completly copie of app folder? > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: CakePhp and Extjs tree
I was reading the docs for cake 1.2 (http://tempdocs.cakephp.org/) and found out that there is a tree behavior. Maybe this could help with getting the correct data into the correct format. I haven't dug into it yet due to lack of time, but it might be worth looking at. On Jan 24, 8:19 am, Paolo <[EMAIL PROTECTED]> wrote: > Hi! Thanks for your answer, I tried using a function that loads all > the children of the tree and puts them, formatted in a particular way, > in a textbox. I can read that textbox and parse it to add all the > relevant stuff to the db. I'll post a tutorial soon. > > Thanks > > On 23 Gen, 19:39, hydra12 <[EMAIL PROTECTED]> wrote: > > > I haven't tried this yet. You might look here for some basic > > information: > > http://extjs.com/learn/Tutorial:Ext20_Tree_TreeLoader_PHP_MySQL > > > The main problem I see with doing this with cake is getting your data > > in the correct format. I have some other extjs tutorials; maybe I can > > get atreetutorial up sometime. You can find my other stuff > > here:http://www.ntatd.org/mark. Maybe some of it will help, since the > > datagrids do cover outputting data in json format. > > > hydra12 > > > On Jan 22, 8:14 am, Paolo <[EMAIL PROTECTED]> wrote: > > > > Hi all! > > > Hasanyone tried to integrate cake with extjstree? I qould like the > > > used to edit the structure of a menu using extjs drag and drop tools > > > on atree, and then get the values (for ezample, a sequence of root -> > > > node 1, node 2-> node 3 -> node 4 > > > and then update the parent in the db fields. > > > Any idea? > > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: An Idea For Ease Of Developing Views
I'll have to agree. I confess that, when I first started using cake, I hated using php in my views. I had been using smarty and a few other templating systems, and I thought they were better. I was wrong. Adding a templating system adds one more level to debug and one more level where things can go wrong. PHP works great, cake devs already know it, and it can be very nice looking if you design your site properly. hydra12 On Jan 24, 7:52 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 24, 2008 5:41 AM, Gary Taylor <[EMAIL PROTECTED]> wrote: > > > > > I would love to see this as an addon to cake or even built in. I > > can't stand using php in my view code (even though I am a php > > programmer !), I have tried flexy and about to try smarty. > > PHP itself is a templating language, so I do wonder why people work so > hard to add another layer of processing and overhead to a PHP-based > application. If you have designers who can't be bothered to learn a > little PHP in order to use PHP-based templates, well, I suggest you > get some new designers who are actually willing to learn something > new. > > Templating systems in PHP are a solution looking for a problem. > > -- > 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 "Cake PHP" 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: application falls
Just off the top of my head (I'm not a bsd guy), make sure that whatever user apache runs under has permissions on the directory where your app is. On Jan 22, 5:01 am, galem <[EMAIL PROTECTED]> wrote: > First of all, sorry for my english! > Has written the appendix on cakePHP. Have established on a hosting. > There were problems: periodically the appendix falls with mistake > > Warning: require(cake/bootstrap.php) [function.require]: failed to > open stream: No such file or directory in /usr/home/oly/data/www/ > rored.ru/app/webroot/index.php on line 82 > > Fatal error: require() [function.require]: Failed opening required > 'cake/bootstrap.php' (include_path='.:/usr/local/share/pear') in /usr/ > home/oly/data/www/rored.ru/app/webroot/index.php on line 82 > > Probably, problems with Apache as at it reboot starts to work. > On server: > FreeBSD6 (7) > Apache2 > PHP5 > MySQL 5 > eAccelerator 0.9.5 > CakePHP 1.1 > Last time support has informed, that: "... Problems are eliminated. A > problem that function ini_set in a file app/webroot/index.php > periodically does not fulfil correctly. Now we have corrected > adjustments of a server, the mistake has disappeared. " But the > mistake has again arisen. A hosting to change it is not obviously > possible. What can i do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: CakePhp and Extjs tree
I haven't tried this yet. You might look here for some basic information: http://extjs.com/learn/Tutorial:Ext20_Tree_TreeLoader_PHP_MySQL The main problem I see with doing this with cake is getting your data in the correct format. I have some other extjs tutorials; maybe I can get a tree tutorial up sometime. You can find my other stuff here: http://www.ntatd.org/mark. Maybe some of it will help, since the datagrids do cover outputting data in json format. hydra12 On Jan 22, 8:14 am, Paolo <[EMAIL PROTECTED]> wrote: > Hi all! > Hasanyone tried to integrate cake with extjs tree? I qould like the > used to edit the structure of a menu using extjs drag and drop tools > on a tree, and then get the values (for ezample, a sequence of root -> > node 1, node 2-> node 3 -> node 4 > and then update the parent in the db fields. > Any idea? > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Redirecting to another url in cake
A couple of things: first, I'd use the html link helper to make links. link('Test', '/controller/action'); ?> Second, it should be /controller/action, not controller/action. Third, pagesController is a built-in part of cake, so you can't have a controller called pages. In reference to your routes question, no, you shouldn't have to set a route for every link you make. If you follow the /controller/action model, things should just work. hydra12 On Jan 21, 2:45 pm, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello hydra, > > you got my point right. But here i have a little query regarding routes as > well. Please bear with me as i am new to cake. > > lets say that i have a layout default.thtml. and i am having a link in the > default page which points to some other page(which happens to be the cake > page itself). Let the other controller be PagesController. now here is how i > wrote the link to the pages controller's index action in default.thtml. > > Test > > This above link does not redirect to the index action and finally to the > index.thtml of PagesController untill i define the entry saying > > $Route->connect('/pages/*', array('controller' => 'pages', 'action' => > 'index')); in routes.php > > Is this how cake designed to work? Am i supposed to route every such entry > in routes.php? > > Any help is highly appreciated. > > Thanks. > > On 1/21/08, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm still unsure what you are wanting. Are all of these new pages > > going to be cake pages, or are they going to be static pages? If they > > are cake pages, then your two points are correct. Sometimes it is > > easier to make a new layout. > > > On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> > > wrote: > > > Hello, > > > > Actually i am trying to port a legacy application. In the page there are > > a > > > lot of forwards thro html tag. Now what i was thinking was that > > > what is the best way to convert these tags new layouts, or the same > > layout > > > with different views loading at different time. After i researched i > > came to > > > following conclusions: > > > > 1. If the layout is quite different, then new layout would be better > > > otherwise existing layout would be cluttered with code. > > > 2. If the layout is not that different, then new view in the same layout > > is > > > a better choice. > > > > Please correct me if i am wrong. > > > > Thanks. > > > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > What exactly are you trying to accomplish? > > > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > > > wrote: > > > > > Hello guys, > > > > > > What is the best way to handle the redirections such as in cake php. Do i define new layout for the > > page > > > > > mypage or should i have seperate view and load it in the exisiting > > > > layout > > > > > only. The new page to be loaded is quite different from the another > > > > page. > > > > > > -- > > > > > Thanks & Regards, > > > > > Novice (http://ishuonweb.wordpress.com/). > > > > -- > > > Thanks & Regards, > > > Novice (http://ishuonweb.wordpress.com/). > > -- > Thanks & Regards, > Novice (http://ishuonweb.wordpress.com/).- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Redirecting to another url in cake
I'm still unsure what you are wanting. Are all of these new pages going to be cake pages, or are they going to be static pages? If they are cake pages, then your two points are correct. Sometimes it is easier to make a new layout. On Jan 19, 1:37 am, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello, > > Actually i am trying to port a legacy application. In the page there are a > lot of forwards thro html tag. Now what i was thinking was that > what is the best way to convert these tags new layouts, or the same layout > with different views loading at different time. After i researched i came to > following conclusions: > > 1. If the layout is quite different, then new layout would be better > otherwise existing layout would be cluttered with code. > 2. If the layout is not that different, then new view in the same layout is > a better choice. > > Please correct me if i am wrong. > > Thanks. > > On 1/19/08, bright_o <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > What exactly are you trying to accomplish? > > > On Jan 18, 1:39 pm, "Novice Programmer" <[EMAIL PROTECTED]> > > wrote: > > > Hello guys, > > > > What is the best way to handle the redirections such as in cake php. Do i define new layout for the page > > > mypage or should i have seperate view and load it in the exisiting > > layout > > > only. The new page to be loaded is quite different from the another > > page. > > > > -- > > > Thanks & Regards, > > > Novice (http://ishuonweb.wordpress.com/). > > -- > Thanks & Regards, > Novice (http://ishuonweb.wordpress.com/). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 - DHTML Suite
I'm glad it worked for you! On Jan 21, 11:06 am, ryoungsma <[EMAIL PROTECTED]> wrote: > Thank you so much for the help. With your guidance I was able to work > this out. If interested here is the what it looks like. > > > function createNewWindow(id) > { > var host ='<?php echo $_SERVER['HTTP_HOST']; ?>'; > var viewId = id; > var newWindowModel = new DHTMLSuite.windowModel( > {windowsTheme:false,id:'newWindow', > title:'New dynamically created window', > xPos:200,yPos:200,minWidth:null,minHeight:null } ); > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > contentUrl:"<a rel="nofollow" href="http://"+host+"/inventory/generals/view/"+viewId}">http://"+host+"/inventory/generals/view/"+viewId}</a> ); > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > newWindowWidget.init();} > > > > I now pass an 'id' to the script as well. > > Thank you. > > On Jan 21, 10:58 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > OK, a couple of things. First, I've never used DHTML Suite, but this > > works for me using extjs. I think it will work for you, too. > > > First, try hard-coding your url: > > > contentUrl: 'http://localhost/myapp/vendor/view/107'//orwhatever > > your url is :-) > > > Note: if you put localhost in, you have to call the site from > > localhost in your browser or you get permission denied errors on your > > ajax call. For example, my dev laptop is named tc-mark-lap. If I put > > localhost in my js code but try to call the code > > withhttp://tc-mark-lap/myapp/vendor/view/107inmy browser, it won't work. > > > This will (I hope) fix your problem. You can check firebug to see > > what your ajax call returns (to make sure that your ajax is working > > even if there is a problem with your js code). In my code, I define a > > javascript variable in my default layout like this: > > > > > var host = '<?php echo $_SERVER['HTTP_HOST']; ?>'; > > > > > In my javascript code, I put this for my ajax url: contentUrl: > > 'http://'+host+'/myapp/vendor/view/107' > > > I hope that helps some. > > > hydra12 > > > On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > Here is the js code to generate the window > > > > > > > function createNewWindow() > > > { > > > var newWindowModel = new DHTMLSuite.windowModel( > > > {windowsTheme:false,id:'newWindow', > > > title:'New dynamically created window', > > > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > > > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > > > contentUrl:'vendor\view\107' } );\\this is the URL to load > > > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > > > newWindowWidget.init();} > > > > > > > Create window > > > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > Can you show the relevant js code? Specifically, how are you > > > > inputting the url? > > > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > > > application. I am using their Window Widget to retrieve some > > > > > information via AJAX. The issue is that it uses the URL as a > > > > > parameter when when you create the window from Javascript. Cake > > > > > always seems to return a message that it is looking for a different > > > > > controller. > > > > > > For example, the URL entered into the parm field is '\vendors\view > > > > > \105' > > > > > > Here is what Cake is reporting for an error. > > > > > > > > > class VendorsController extends AppController { > > > > > > var $name = 'Vendors'; > > > > > > function viewG() { > > > > > > } > > > > > > } > > > > > > ?> > > > > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 test that adatabase table exists ?
Here's an idea: assuming you have a table users with data in it and a table schools that is empty. In the users controller: function test() { $data = "select * from users limit 0,1"; //custom query, limit to make things run faster $temp = $this->User->execute($data); if($temp) { debug('table exists'); } else { debug('table does not exist'); } } When I call /users/test, I get 'table exists'. If I change $data to use the schools table instead of the users table, I get 'does not exist' - it returns no data because the table is empty. If I change users to a non-existent table like tests, I get 'does not exist' - the table doesn't exist. There may be a better way to do this, but I can't find it. On Jan 20, 7:54 am, foxmask <[EMAIL PROTECTED]> wrote: > Hello > nobody to give a suggestion ? > > On Jan 18, 9:39 pm, foxmask <[EMAIL PROTECTED]> wrote: > > > Good evening, > > I would like to test if my database table exists or not > > If no, i will display a message to suggest to install the software > > If yes, i will "Route::connect()" to the main page of the software. > > > I digged on the Model::Schema() but i dunno how to use it nor if it's > > the well way to do the trick. > > > kind regards. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: cakephp 1.2 :: Database prefix and tips about sanitize
I could be wrong, but I don't think you have to do anything to use the database prefix. That's configured in database.php. On Jan 19, 1:21 pm, Josoroma <[EMAIL PROTECTED]> wrote: > I have an afterSave function inside a model, my two questions are: > > #1 How do i use the database prefix? > > #2 Do i need to sanitize $data['User']['username'] and $data['User'] > ['id']? > > Thanks in advance. > > function afterSave(){ > > $data = $this->read(); > $this->query('UPDATE `bm_aros` SET `alias` = \'' . $data['User'] > ['username'] . '\' WHERE `model` = \'User\' AND `foreign_key` = ' . > $data['User']['id']); > return true; > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Confused using forms (i think!)
I haven't ever tried this, but I think that $this->User->Usertype- >find() needs to be $this->User->Usertype->findAll() if you want to get a list of all the different user types. Best way to do this - use bake to make your views, then see how it handles this. On Jan 19, 3:57 pm, judouk <[EMAIL PROTECTED]> wrote: > Sorry guys - another newbie question. > > I've got an install of cake 1.2 > I have a users table which I have associated with a usertypes table. > > My database setup (cut down for simplicity) is; > > create table usertypes ( > id int(10) not null auto_increment, > choice varchar(100) not null, > ) type = myisam; > > create table users ( > id int(10) not null auto_increment, > username varchar(15) not null, > usertype_id int(10) not null, > ) type = myisam ; > > So, what I'm trying to do is to create a new view/controller to add a > new user. > However, I also want to use a selection of the usertypes. > > I've gone through various applications (and thoroughly confused > myself!) but have ended up creating two models; > user.php > class User extends AppModel > { > var $name = 'User'; > var $belongsTo = array( > 'Usertype' => array( > 'className' => 'Usertype', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'usertype_id' > ) > ); > > } > > usertype.php >class Usertype extends AppModel > { > var $name = 'Usertype'; > var $hasMany = array( > 'User' => array( > 'className' => 'User', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'usertype_id' > ) > ); > }; > ?> > > My controller (again, very much cut down) is > class UsersController extends AppController > { > var $name = 'Users'; > var $helpers = array('Html', 'Form'); > function register() > { > if (!empty($this->data)) > { > // i'll do some validation here > } else { > $this->set('usertypes', $this->User->Usertype->find()); > $this->render(); > } > }} > > ?> > > I think the line which is wrong is >$this->set('usertypes', $this->User->Usertype->find()); > but I'm not sure. > > Ultimately, I want to be able to do something like > > method="post"> > > labelTag('Users/usertype_id', > 'Username'); ?> > selectTag('Users/usertype_id', > $usertypes, $html->tagValue('Users/usertype_id'), array(), array(), > true); ?> > tagErrorMsg('Users/usertype_id', 'Please > select a user type.'); ?> > > > submit('Add'); ?> > > > > although this may be wrong too. > > Hopefully, I've provided enough info (possibly too much). > > Please help. > > Thanks > J --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Simple Bog tutorial Sorting question
findAll is a model function, so you can find it in the manual under models, or you can find it in the api under models. Don't feel bad if you have trouble finding things at first - we all do. As long as you make an honest effort to find things first, you'll find that the cake community is really great about helping point you in the right direction. hydra12 On Jan 20, 10:35 am, justradar <[EMAIL PROTECTED]> wrote: > ... but i guess i was likely searching for the WRONG vocabulary ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Setting $useDbConfig at runtime with cake 1.2 beta
Look at the values in $this->params (it's an array with all the parameters passed to the controller). If selenium is always the last parameter, you could check that, or you could just do: if(in_array('selenium', $this->params) { $this->useDbConfig='selenium'; } HTH! hydra12 On Jan 19, 11:58 pm, Steve Boyd <[EMAIL PROTECTED]> wrote: > Hey I'm wanting to use Selenium to do some functional testing and want > to use a separate database its own test data (essentially using this > database as a group of fixtures) > > I wanting use my urls like : /:controller/:action/:id/selenium > > idea being that when /selenium is present then my app => $useDbConfig > = 'selenium', otherwise just use 'default' > > currently i can get it to work with an exceptionally ugly hack from > within my parent model (all my other models extend this one) > > class TestableAppModel extends AppModel { > > function TestableAppModel() { > if > (preg_match('/\/selenium$/',$_SERVER['REQUEST_URI'])) { > $this->useDbConfig = 'selenium'; > } > $this->AppModel(); > } > > Anyone know of a nicer way to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 - DHTML Suite
OK, a couple of things. First, I've never used DHTML Suite, but this works for me using extjs. I think it will work for you, too. First, try hard-coding your url: contentUrl: 'http://localhost/myapp/vendor/view/107' //or whatever your url is :-) Note: if you put localhost in, you have to call the site from localhost in your browser or you get permission denied errors on your ajax call. For example, my dev laptop is named tc-mark-lap. If I put localhost in my js code but try to call the code with http://tc-mark-lap/myapp/vendor/view/107 in my browser, it won't work. This will (I hope) fix your problem. You can check firebug to see what your ajax call returns (to make sure that your ajax is working even if there is a problem with your js code). In my code, I define a javascript variable in my default layout like this: var host = '<?php echo $_SERVER['HTTP_HOST']; ?>'; In my javascript code, I put this for my ajax url: contentUrl: 'http://'+host+'/myapp/vendor/view/107' I hope that helps some. hydra12 On Jan 21, 9:38 am, ryoungsma <[EMAIL PROTECTED]> wrote: > Here is the js code to generate the window > > > function createNewWindow() > { > var newWindowModel = new DHTMLSuite.windowModel( > {windowsTheme:false,id:'newWindow', > title:'New dynamically created window', > xPos:200,yPos:200,minWidth:400,minHeight:600 } ); > newWindowModel.addTab({ id:'myTab',htmlElementId:'myTab',tabTitle:'tab1', > contentUrl:'vendor\view\107' } );\\this is the URL to load > var newWindowWidget = new DHTMLSuite.windowWidget(newWindowModel); > newWindowWidget.init();} > > > Create window > > On Jan 21, 9:51 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > Can you show the relevant js code? Specifically, how are you > > inputting the url? > > > On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > > > > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > > > application. I am using their Window Widget to retrieve some > > > information via AJAX. The issue is that it uses the URL as a > > > parameter when when you create the window from Javascript. Cake > > > always seems to return a message that it is looking for a different > > > controller. > > > > For example, the URL entered into the parm field is '\vendors\view > > > \105' > > > > Here is what Cake is reporting for an error. > > > > > class VendorsController extends AppController { > > > > var $name = 'Vendors'; > > > > function viewG() { > > > > } > > > > } > > > > ?> > > > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 - DHTML Suite
Can you show the relevant js code? Specifically, how are you inputting the url? On Jan 21, 7:29 am, ryoungsma <[EMAIL PROTECTED]> wrote: > I am looking at using the DHTML Suite (dhtmlgoodies.com) with my > application. I am using their Window Widget to retrieve some > information via AJAX. The issue is that it uses the URL as a > parameter when when you create the window from Javascript. Cake > always seems to return a message that it is looking for a different > controller. > > For example, the URL entered into the parm field is '\vendors\view > \105' > > Here is what Cake is reporting for an error. > class VendorsController extends AppController { > > var $name = 'Vendors'; > > function viewG() { > > } > > } > > ?> > > Any thoughts? Have I provided enough information? Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Inserting multiple records into the same model from one form
I wrote a tutorial on this awhile back. You can find it here: http://www.ntatd.org/mark/?p=28. It's a little bit strange because of the date stuff I was also having to deal with (it's just working code from a project I had), but maybe it will help a little. Let me know if I can help. hydra12 On Jan 15, 4:00 pm, Brian <[EMAIL PROTECTED]> wrote: > I want to insert multiple records into a single model using a single > form. So let's say you want a form that collects 30 names and then > inserts 30 records into a "people" model/table. In standard code I > would uniquely name all form elements and then use a loop to dump them > in to the table. How can I do this in Cake? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Installation/htaccess problems
Why did you change the .htaccess file? I'm assuming that cakeblog is actually your cake folder, with cake and app inside? If so, then you should be able to go to http://localhost/~reuben/cakeblog/ and everything should work without changing the .htaccess file at all. If you have a different directory structure, there are ways to make it work, but I don't thing you need to change the .htaccess file. hydra12 On Jan 15, 3:37 pm, Reuben Avery <[EMAIL PROTECTED]> wrote: > Hi all, > > Having some difficulty getting off the ground here with the cake blog > tutorial, wondering if maybe someone might have an idea. > > I have installed cakephp athttp://localhost/~reuben/cakeblog/ > > I modified the root .htaccess file and added 'RewriteBase /~reuben/ > cakeblog/' and was then able to load the default root page just > fine. > > But going to any directory underneath the cakeblog root (for > example,http://mission/~reuben/cakeblog/postsas per the blog tutorial), I am > getting a 404. Looking at the httpd log, each of these requests is > being rewritten to '/Library/WebServer/Documents/Users' .. (using a > Mac here, and the default document root is set to /Library/WebServer/ > Documents) > > Not having problems with anything else in ~reuben/ so I am presuming > this is an issue with that htaccess file > > Thanks for any advice! > Reuben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Array Structure using alias Fieldnames in findAll() Method
I can't help you with mssql or aliases, but I might be able to help with the json stuff. If I understand you correctly, you are wanting to get your data into a good json format (ie - not have the data nested in so many arrays). You might Set::extract(). You can find a short tutorial here: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/ I have an example that uses this to create a json string here: http://www.ntatd.org/mark/?p=29. I hope that helps some. I know it's not what you actually asked for, but maybe it will help in the mean time. hydra12 On Jan 16, 7:14 am, Fraed <[EMAIL PROTECTED]> wrote: > Hi, > > i am using Cakephp 1.2.0.6311 beta with mssql. > > Im trying to use Alias-Names in the findAll()-Method. (eg in SQL: > SELECT name AS text from table). Everytime setting up the field > parameter like array('name AS text') the returned Array-Structure is > unusable. A value would be accessable as: > > $data[0][Model][0][Model][0]['text'] instead of $data[0][Model][text] > > Fields without an Alias have their right place. > > Is there any way to work with aliases and set up the Array structure > correctly? This would be very helpful to encode some json_data and > maybe also for other things. Maybe the defnition in the field array is > wrong. But theres no hint where aliases can be defined on other > points. Is it working with mysql? Cant test it here in Company. > > Thanks for your help > > Fraed --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Redirect to a wrong url when i login successfully
It would help if you could post your code. What address did you tell your page to redirect to? If you just want to redirect to http://www.test.com/app/, you could try redirecting to '/'. I hope that helps. hydra12 On Jan 16, 8:03 am, KnightE <[EMAIL PROTECTED]> wrote: > Hi, I'm new to cakephp 1.2, and touch the Auth Component few hours. > After read some articles about Auth, I made a simple case. > Everything is fine, but when I login successfully, the page redirect > to a wrong url. > > First, I goto my project default page (e.g.http://www.test.com/app/). > Then I click "Login" link from this page, and > gotohttp://www.test.com/app/users/login > After complete the form, and click the "Login" button, I got a error > msg said Missing Controller, because the browser redirect a url like > this:http://www.test.com/app/http:/www.test.com/app > > It seems that the Router::normalize made the strange url... > What's wrong with my code? Did I miss something importent?? > > Thx for help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: cakephp directory structure
There are several different ways to approach this, but I've never heard the one you just heard. The way you are doing it is a standard way if you only want to have 1 app - you put your controller in /app/ controllers, your model in /app/models, and your views in /app/views/ controllername/. If you want to have several different apps, you can create a folder inside cakephp for each app (essentially, just copy the app folder and rename it). If you put things in /app/addressbook/, I don't think it would work. hydra12 On Jan 17, 3:27 am, aamir <[EMAIL PROTECTED]> wrote: > Hello, > I have created a small address book in cakephp and I have used the > default directory structure of cakephp. E.g. > > I have stored my addresses_controller.php in > cakephp\app\controllers\addresses_controller.php > > and address.php ( model ) in > cakephp\app\models\address.php > > and views files in views folder e.g. > cakephp\app\views\addresses\add.thtml > > is this approach ok? > > i have just heard that i need to create a folder in app for my every > new site. E.g. > cakephp\app\addressbook > > and then i need to create controller, model and views directories in > this directory. > > Please assist me what should I do? > > Thanks, > Aamir. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: javascript declarations
Try this instead: link('prototype.js')); echo ($javascript->link('scriptaculous.js')); } ?> This is the normal way to write an if statement in php. I don't know if the other way will work or not. hydra12 On Jan 15, 7:59 pm, "b logica" <[EMAIL PROTECTED]> wrote: > On Jan 14, 2008 6:21 PM, top123 <[EMAIL PROTECTED]> wrote: > > > > > I'm try this way for access my javascripts file : > > > > > if(isset($javascript)): > > echo ($javascript->link('prototype.js')); > > echo ($javascript->link('scriptaculous.js')); > > . > > endif; > > ?> > > > > but I got something error to include the javascript file to my CAKE, > > my FireBug (Mozzila) said "unterminated.something", > > As a guess, the "unterminated.something" suggests that you're > missing a quote somewhere in your JS. > > You'd probably do better to paste the exact error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
@foxmask - can you post your code someplace where I can look at it? On Jan 12, 7:47 am, foxmask <[EMAIL PROTECTED]> wrote: > on my side i get the grid and the string : > {"total":2, "users":[{"username":"foxmask", "title":"", > "realname":""}, {"username":"Invité", "title":"", "realname":""}]} > > display just after the grid . > > On Jan 11, 11:15 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > OK, the forms tutorial is up now. You can find it > > here:http://www.ntatd.org/mark/?p=31. Have a great weekend! > > > On Jan 11, 8:38 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > That's what it's supposed to do. getAllUsers just returns a json > > > string with data from the database. Now call myroot/users/index. It > > > should show a datagrid with all the json data in it. The way it works > > > is this: index is pretty much blank, but it loads myScript.js (or > > > whatever you named it). myScript.js calls getAllUsers on line 17: > > > > proxy: new Ext.data.HttpProxy({url: 'http://'+host+'/ext/users/ > > > getAllUsers'}), > > > > When you call index, it should call getAllUsers and load the data > > > returned into your store. When you render your datagrid, it pulls > > > data from the store and puts it in the grid. The fact that you are > > > getting the json string when you call getAllUsers directly means > > > you're on the right track. Let me know if I can help. > > > > BTW, I'm about 1/2 way done on a forms tutorial . . . > > > > hydra12 > > > > On Jan 11, 8:13 am, inma <[EMAIL PROTECTED]> wrote: > > > > > Thank you Hidra12! > > > > > I read your datagrid tutorial for ext-2.0. > > > > > I'm using ext-2.0 and CakePHP 1.2 Beta, too. > > > > > But when I call to myroot//users/getAllUsers, it shows that: > > > > > {"total":8, "users":[{"id":6, "username":"archangel", > > > > "fullname":"Worthington, Warren"}, {"id":2, "username":"cyclops", > > > > "fullname":"Summers, Scott"}, {"id":8, "username":"gambit", > > > > "fullname":"LeBeau, Remy"}, {"id":1, "username":"hydra12", > > > > "fullname":"Buckner, Mark"}, {"id":5, "username":"iceman", > > > > "fullname":"Drake, Bobby"}, {"id":3, "username":"nightcrawler", > > > > "fullname":"Wagner, Kurt"}, {"id":7, "username":"storm", > > > > "fullname":"Munroe, Ororo"}, {"id":4, "username":"wolverine", > > > > "fullname":"Logan"}]} > > > > > On 10 ene, 21:37, hydra12 <[EMAIL PROTECTED]> wrote: > > > > > > OK, I did some searching and found this > > > > > thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
OK, the forms tutorial is up now. You can find it here: http://www.ntatd.org/mark/?p=31. Have a great weekend! On Jan 11, 8:38 am, hydra12 <[EMAIL PROTECTED]> wrote: > That's what it's supposed to do. getAllUsers just returns a json > string with data from the database. Now call myroot/users/index. It > should show a datagrid with all the json data in it. The way it works > is this: index is pretty much blank, but it loads myScript.js (or > whatever you named it). myScript.js calls getAllUsers on line 17: > > proxy: new Ext.data.HttpProxy({url: 'http://'+host+'/ext/users/ > getAllUsers'}), > > When you call index, it should call getAllUsers and load the data > returned into your store. When you render your datagrid, it pulls > data from the store and puts it in the grid. The fact that you are > getting the json string when you call getAllUsers directly means > you're on the right track. Let me know if I can help. > > BTW, I'm about 1/2 way done on a forms tutorial . . . > > hydra12 > > On Jan 11, 8:13 am, inma <[EMAIL PROTECTED]> wrote: > > > Thank you Hidra12! > > > I read your datagrid tutorial for ext-2.0. > > > I'm using ext-2.0 and CakePHP 1.2 Beta, too. > > > But when I call to myroot//users/getAllUsers, it shows that: > > > {"total":8, "users":[{"id":6, "username":"archangel", > > "fullname":"Worthington, Warren"}, {"id":2, "username":"cyclops", > > "fullname":"Summers, Scott"}, {"id":8, "username":"gambit", > > "fullname":"LeBeau, Remy"}, {"id":1, "username":"hydra12", > > "fullname":"Buckner, Mark"}, {"id":5, "username":"iceman", > > "fullname":"Drake, Bobby"}, {"id":3, "username":"nightcrawler", > > "fullname":"Wagner, Kurt"}, {"id":7, "username":"storm", > > "fullname":"Munroe, Ororo"}, {"id":4, "username":"wolverine", > > "fullname":"Logan"}]} > > > On 10 ene, 21:37, hydra12 <[EMAIL PROTECTED]> wrote: > > > > OK, I did some searching and found this > > > thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
That's what it's supposed to do. getAllUsers just returns a json string with data from the database. Now call myroot/users/index. It should show a datagrid with all the json data in it. The way it works is this: index is pretty much blank, but it loads myScript.js (or whatever you named it). myScript.js calls getAllUsers on line 17: proxy: new Ext.data.HttpProxy({url: 'http://'+host+'/ext/users/ getAllUsers'}), When you call index, it should call getAllUsers and load the data returned into your store. When you render your datagrid, it pulls data from the store and puts it in the grid. The fact that you are getting the json string when you call getAllUsers directly means you're on the right track. Let me know if I can help. BTW, I'm about 1/2 way done on a forms tutorial . . . hydra12 On Jan 11, 8:13 am, inma <[EMAIL PROTECTED]> wrote: > Thank you Hidra12! > > I read your datagrid tutorial for ext-2.0. > > I'm using ext-2.0 and CakePHP 1.2 Beta, too. > > But when I call to myroot//users/getAllUsers, it shows that: > > {"total":8, "users":[{"id":6, "username":"archangel", > "fullname":"Worthington, Warren"}, {"id":2, "username":"cyclops", > "fullname":"Summers, Scott"}, {"id":8, "username":"gambit", > "fullname":"LeBeau, Remy"}, {"id":1, "username":"hydra12", > "fullname":"Buckner, Mark"}, {"id":5, "username":"iceman", > "fullname":"Drake, Bobby"}, {"id":3, "username":"nightcrawler", > "fullname":"Wagner, Kurt"}, {"id":7, "username":"storm", > "fullname":"Munroe, Ororo"}, {"id":4, "username":"wolverine", > "fullname":"Logan"}]} > > On 10 ene, 21:37, hydra12 <[EMAIL PROTECTED]> wrote: > > > OK, I did some searching and found this > > thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
OK, I did some searching and found this thread: http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152746ddb38/48bde29ad0776d1f?lnk=gst&q=extjs#48bde29ad0776d1f --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Looking for an example with Extjs lib
I just posted a newer tutorial that works with ext-2.0 and cake 1.2 beta here: http://www.ntatd.org/mark/?p=30 On Nov 26 2007, 10:12 am, hydra12 <[EMAIL PROTECTED]> wrote: > OK, I now have an example to share. It's fairly long, so I won't post > it here, but you can find it on my blog. http://www.ntatd.org/mark/?p=29 > I hope that helps you some. If you have any questions, let me know. > hydra12 > > On Nov 21, 5:19 pm, aniston <[EMAIL PROTECTED]> wrote: > > > Thankx Hydra, will wait for your examples, in the mean time have a > > nice vacation wherever you are :) > > ..aniston > > > On 21 Nov, 15:41, hydra12 <[EMAIL PROTECTED]> wrote: > > > > I have usedextjswith cake a few times. I'll send you some examples > > > later, but I'm on vacation right now and away from my dev. machine. > > > > hydra12 > > > > On Nov 21, 5:42 am, aniston <[EMAIL PROTECTED]> wrote: > > > > > Hello, I found the edit-grid example ofextjsvery neat and was > > > > looking for an example setup with cake if anyone has used this > > > > alreadyhttp://extjs.com/deploy/dev/examples/grid/edit-grid.html > > > > > Must admit i'm a new to AJAX and Javascript and risk a kicking from > > > > the grus and pros who might dislike the asking for an example straight > > > > out but I found it easier to "Learn by example" and then dig into the > > > > code to suit it to my needs. > > > > > On the practical end I tried including the ext-base.js, ext-core.js > > > > and ext-all.js incl. the edit-grid.js libs with the default.thtml but > > > > ended up with Ext is not defined errors (trying to recreate a working > > > > sample of a standard 3x3 table) > > > > > any help in howto start with this is appreciated. > > > > > ciao, > > > > aniston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
OK, I've updated my datagrid tutorial for ext-2.0. You can find it here: http://www.ntatd.org/mark/?p=30. I'll try to work on forms next. If I remember correctly, you build the form itself in ext just like in the tutorials. When you want to submit, do it as a post. In your controller, you have to take the post data ($_POST) and rewrite it to fit cake's array preferences, then you can save to the database. hydra12 On Jan 10, 5:13 am, foxmask <[EMAIL PROTECTED]> wrote: > i tried to repeat the step of your example with ext 1.1.1 here is my > ajax.ctp > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > http://www.w3.org/1999/xhtml"; xml:lang=" __('lang_iso_code') ?>" > lang="" dir=""> > > > > > > > charset(__('lang_encoding',true));?> > > > link('ext-1.1/adapter/ext/ext-base'); ?> > > link('ext-1.1/ext-all-debug'); ?> > > link('myScript'); ?> > > > > > > > Object($users).'}'; ?> > > > > > i think i made a mistake because that display the content of > { ... } ... > > On Jan 9, 8:02 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > I'm working on a new version of my tutorial that works with 2.0. I'll > > try to get it done soon, depending on my work schedule. > > > hydra12http://www.ntatd.org/mark > > > On Jan 9, 12:23 pm, DjZoNe <[EMAIL PROTECTED]> wrote: > > > > Hi inma, > > > > I started to write here a little help, but it became bigger as I > > > expected. > > > So I rather posted into my blog:http://djz.hu/blog/posts/689 > > > > -- > > > DjZoNe > > > > > Hi, > > > > > I'm newbie in CakePHP andExtJS. I'm developing a new application with > > > > CakePHP, and I want to integrate theExtJSforms into this > > > > application. I was looking some posts about it. > > > > > Nevertheless, I don't know how to match Cake model, controller and > > > > view withExtJSexactly. :-( > > > > > Can someone post an example (basic example) with this combination > > > > (cake model, controller and view withExtJS)? > > > > > Thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 combine CakePHP + ExtJS?
I'm working on a new version of my tutorial that works with 2.0. I'll try to get it done soon, depending on my work schedule. hydra12 http://www.ntatd.org/mark On Jan 9, 12:23 pm, DjZoNe <[EMAIL PROTECTED]> wrote: > Hi inma, > > I started to write here a little help, but it became bigger as I > expected. > So I rather posted into my blog:http://djz.hu/blog/posts/689 > > -- > DjZoNe > > > Hi, > > > I'm newbie in CakePHP and ExtJS. I'm developing a new application with > > CakePHP, and I want to integrate the ExtJS forms into this > > application. I was looking some posts about it. > > > Nevertheless, I don't know how to match Cake model, controller and > > view with ExtJS exactly. :-( > > > Can someone post an example (basic example) with this combination > > (cake model, controller and view with ExtJS)? > > > Thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: add form in index.ctp
I haven't tested this (away from my dev computer for Christmas), but I think that $form->input without any options is your problem. If you don't give it any options, cake has to guess at what kind of input you want. Since message belongs to user, cake thinks you want a select box. Try this: input('message', array('type'=>'text')); ?> Note - I haven't tested this, just going from memory and a quick check of the api: http://api.cakephp.org/1.2/class_form_helper.html#986b871ad98a20ed1ce3b8ec42d63ce3 Hope that helps! hydra12 On Dec 27, 5:23 am, krr <[EMAIL PROTECTED]> wrote: > php version: 4.4.2 > cakephp: 1.2 > > I have 2 models, User and Message. User is for authenticating users > and Message are the messages from users. Message belongsTo User. > > messages table fields > message (message body) > user_id (foreign key to users, auto filled from session) > created_date (current timestamp, auto filled) > > To keep UI simple, I have put an 'Add Message' form in the index page > of messages. > > create('Message');?> > > true));?> > echo $form->input('message'); > ?> > > end('Submit');?> > > The problem is the above form shows the input for message as a drop > down (instead of textbox) with all the values from all columns in the > messages table. > > Any clue what might be wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Integration of Ext js in cakephp
Here's a tutorial on using the datagrid with cake: http://www.ntatd.org/mark/?p=29. Read the comments at the bottom: they point to a discussion that has more information. I'm working on an update for the tutorial, but maybe this will help you until then. hydra12 On Dec 26, 3:03 am, ProFire <[EMAIL PROTECTED]> wrote: > Hi and welcome to CakePHP! > > You should put your javascript files in "app/webroot/js" > > After that, you can include all the javascript files in your "views/ > layouts/default.thtml". You may have to create this file if it does > not exist. Just do the standard . You may > wish to check out the manual for more information on layouts. > > Happy Baking! > > On Dec 26, 2:52 pm, [EMAIL PROTECTED] wrote: > > > I am new to cakephp... how to include ext-js folder.? should i put it in > > "vendors" if yes then help me regarding settings and if NO then where > > should i put "ext-js " folder? > > > please reply me on [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 can we create datagrind in cakephp using ajax helper
I need to see your code. Best would be your javascript code and your controller code. I'm on vacation for Christmas, but I'll see what I can do to help. hydra12 On Dec 22, 4:20 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > thanks hydra12, > but still i m not getting greed, > actually in the code below, > > Ext.data.JsonReader = function(meta, recordType){ > meta = meta || {}; > Ext.data.JsonReader.superclass.constructor.call(this, meta, > recordType||meta.fields);}; > > Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { > read : function(response){ > var json = response.responseText; > var o = eval("("+json+")"); > if(!o) { > throw {message: "JsonReader.read: Json object not > found"}; > } > if(o.metaData){ > delete this.ef; > this.meta = o.metaData; > this.recordType = > Ext.data.Record.create(o.metaData.fields); > this.onMetaChange(this.meta, this.recordType, o); > } > return this.readRecords(o); > }, > onMetaChange : function(meta, recordType, o){ > > }, > > 'o' does not have any value, > please help me out > thank you > > On Dec 21, 5:47 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > Yes, you can. It's not so easy to get setup, but I've written a > > tutorial about it here:http://www.ntatd.org/mark/?p=29. > > Also checkout this > > post:http://extjs.com/forum/showthread.php?p=53728#post53728. > > It starts with me asking questions trying to get thedatagridworking, > > then ends with me helping someone else get it working. I'll be > > updating my blog with what I learned soon, but until I do (hey, it's > > Christmas . . .), maybe it will help. I'm also willing to answer > > questions as I have time. > > > Hope that helps! > > hydra12 > > > On Dec 21, 5:36 am, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > thanks for your reply, > > > I still have one question - > > > Can i used this with cakePHP? > > > > On Dec 21, 3:28 pm, dizz <[EMAIL PROTECTED]> wrote: > > > > > There isn't anAjaxhelper for adatagridbut take a look at extjs.com > > > > > On Dec 21, 11:35 am, "[EMAIL PROTECTED]" > > > > > <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > i just want to know , > > > > > how can we create datagrind in cakephp usingajaxhelper > > > > > I have post this topic before this also > > > > > but I didn't find any solution > > > > > please help me, if anyone finds the solution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 can we create datagrind in cakephp using ajax helper
Yes, you can. It's not so easy to get setup, but I've written a tutorial about it here: http://www.ntatd.org/mark/?p=29. Also checkout this post: http://extjs.com/forum/showthread.php?p=53728#post53728. It starts with me asking questions trying to get the datagrid working, then ends with me helping someone else get it working. I'll be updating my blog with what I learned soon, but until I do (hey, it's Christmas . . .), maybe it will help. I'm also willing to answer questions as I have time. Hope that helps! hydra12 On Dec 21, 5:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > thanks for your reply, > I still have one question - > Can i used this with cakePHP? > > On Dec 21, 3:28 pm, dizz <[EMAIL PROTECTED]> wrote: > > > There isn't an Ajax helper for a datagrid but take a look at extjs.com > > > On Dec 21, 11:35 am, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > i just want to know , > > > how can we create datagrind in cakephp using ajax helper > > > I have post this topic before this also > > > but I didn't find any solution > > > please help me, if anyone finds the solution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 submit problem - 403 on www server
Try using an absolute url instead of a relative one (just for kicks). It might help track down the problem. BTW, I HAVE noticed a lag on google groups when posting sometimes. I don't think the group is moderated (as in, having each reply approved by a moderator before being posted). Sometimes things just run slow . . . On Dec 20, 2:50 am, "d'plus" <[EMAIL PROTECTED]> wrote: > > To sum up, the host name in the url needs to match the host name you > > use in your scripts. In other words, don't call use localhost in your > > scripts, and don't call your ajax pages using localhost in your > > browser. It may work on your dev machine, but won't on your > > production server. > > > I hope that helps (hey, I hope it makes sense to someone besides > > me . . .) > > hydra12 > > Thanks for Your reply. > I understand what You mean, but the problem is, that I'm not using > hostname in my URL. > Look: > > [...] new Ajax.Updater('comments_122','/pka/comments/add/122', { [...] > > It's relative URL and it's converted into absolute URL by cake (or > sth). > > BTW, is it normal that replies on this group show with big latency? or > is it my fault? > Is this group moderated? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 submit problem - 403 on www server
I've had similar problems using ajax. Make sure that the url in your address bar matches the url in the script. For example, I develop on my laptop (named tc-mark-lap). I wrote an ajax script and in the url used localhost/ekklesia/users/add. I was testing from another machine, so I put tc-mark-lap/ekklesia/users/add. I got the same "you don't have permission" error. When I changed my script from localhost to tc-mark-lap, it worked. When I tested on my localmachine using localhost in the url in my browser, I got the same error. When I put tc-mark-lap in the browser url, it worked. To sum up, the host name in the url needs to match the host name you use in your scripts. In other words, don't call use localhost in your scripts, and don't call your ajax pages using localhost in your browser. It may work on your dev machine, but won't on your production server. I hope that helps (hey, I hope it makes sense to someone besides me . . .) hydra12 On Dec 19, 4:38 pm, "d'plus" <[EMAIL PROTECTED]> wrote: > Hello > > I've recently uploaded my project onto my webserver, and right now I > can't submit form using AJAX. Everything was working on my local > environment (xampp), but now it's getting 403 error. > > "Forbidden > You don't have permission to access /pka/comments/add/122 on this > server. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request. " > > The url I'm requesting is POSThttp://.www.domain.pl/pka/comments/add/122 > > All other functions triggered by normal links work fine, the only > problem is with this form submitted using AJAX. > All of the controllers and files got the same "644" rights. > > This is the source of the form: > > > id="Commentscomment"> > > > onclick="return false;" /> > Event.observe("submit2068615433", > 'click', function(event){ new Ajax.Updater('comments_122','/pka/ > comments/add/122', {onComplete:function(request){$ > ("add_comment_form_122").reset()}, asynchronous:true, > evalScripts:true, > parameters:Form.serialize(Event.element(event).form), requestHeaders: > ['X-Update', 'comments_122']}) }, false); > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Preventing Duplicate Record Insertion on Page Refresh
Create a session variable and set it to false. Have your page check the session variable every time it loads. If the session variable is false, save the data and set the variable to true. If it is true, don't save the data. I could be more specific, but I don't know exactly what you are doing. If you can give us an idea of what your app does, that would be great. hydra12 On Dec 11, 5:58 am, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Cake and JSON.
:-) I'm glad it worked! On Dec 10, 11:35 am, Marcos Hernández <[EMAIL PROTECTED]> wrote: > Oh, man, you're my savior!!! It works great without touching anything!! > Thanks a lot!! > hydra12 escribió:Try this (works in 1.2): First, put all of your data into a > variable, for instance if your model is called items: $items = > $this->Item->findAll(); $timestamp = 1193692111; // put your timestamp here > $itemArray = Set::extract($items, '{n}.Item'); > $this->set('items','{"timestamp":'. > $timestamp.',"items":'.json_encode($itemArray).'}'); Note - I haven't tested > this, but it's modified from code I use for ExtJS. I blogged about it > here:http://www.ntatd.org/mark/?p=29(shameless plug). Make sure to check the > value of items as sent to your view to make sure all the [ and ] are in the > right place. hydra12 On Dec 10, 3:41 am, kchopein<[EMAIL > PROTECTED]>wrote:Hi!! First of all, thanks for the work! I'm trying to use > the JSON component with the Dojo Toolkit but I'm having a problem: the > generated json code includes the model level, and I only need the data. I > mean, I'm getting this: {"timestamp":1193692111, "items":[ > {"Post":{"id":"1","title":"The title","body":"This is the post > body.","created":"2007-11-07 00:44:54"}}, {"Post":{"id":"2","title":"A title > once again","body":"And the post body follows.","created":"2007-11-07 > 00:45:15"}}, {"Post":{"id":"3","title":"Title strikes back","body":"This is > really exciting! Not.","created":"2007-11-07 00:45:44"}}, {"Post": > {"id":"4","title":"aa","body":"aadadasdas","created":"2007-11-12 > 10:00:45"}} ]} but I need something like this: {"timestamp":1193692111, > "items":[ {"id":"1","title":"The title","body":"This is > ...","created":"2007-11-07 00:44:54"}, {"id":"2","title":"A title once > again","body":"And ...","created":"2007-11-07 00:45:15"} ]} Since I'm a Cake > newbe I don't know if there's a way to do this or if I have to do it myself. > How do you solve this? Thanks in advance!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Cake and JSON.
Try this (works in 1.2): First, put all of your data into a variable, for instance if your model is called items: $items = $this->Item->findAll(); $timestamp = 1193692111; // put your timestamp here $itemArray = Set::extract($items, '{n}.Item'); $this->set('items','{"timestamp":'. $timestamp.',"items":'.json_encode($itemArray).'}'); Note - I haven't tested this, but it's modified from code I use for ExtJS. I blogged about it here: http://www.ntatd.org/mark/?p=29 (shameless plug). Make sure to check the value of items as sent to your view to make sure all the [ and ] are in the right place. hydra12 On Dec 10, 3:41 am, kchopein <[EMAIL PROTECTED]> wrote: > Hi!! > > First of all, thanks for the work! > > I'm trying to use the JSON component with the Dojo Toolkit but I'm > having a problem: the generated json code includes the model level, > and I only need the data. I mean, I'm getting this: > > {"timestamp":1193692111, "items":[ > {"Post":{"id":"1","title":"The title","body":"This is the post > body.","created":"2007-11-07 00:44:54"}}, > {"Post":{"id":"2","title":"A title once again","body":"And the post > body follows.","created":"2007-11-07 00:45:15"}}, > {"Post":{"id":"3","title":"Title strikes back","body":"This is really > exciting! Not.","created":"2007-11-07 00:45:44"}}, > {"Post": > {"id":"4","title":"aa","body":"aadadasdas","created":"2007-11-12 > 10:00:45"}} > ]} > > but I need something like this: > > {"timestamp":1193692111, "items":[ > {"id":"1","title":"The title","body":"This > is ...","created":"2007-11-07 00:44:54"}, > {"id":"2","title":"A title once > again","body":"And ...","created":"2007-11-07 00:45:15"} > ]} > > Since I'm a Cake newbe I don't know if there's a way to do this or if > I have to do it myself. How do you solve this? > > Thanks in advance!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Problems with save
Try this: if(!empty($this->data)) { foreach ($this->data["Tiposviajesusuario"] as $tipo) { $t["usuario_id"] = $u["id"]; $t["tipo_id"] = $tipo; $this->Tiposviajesusuario- >create(); $this->Tiposviajesusuario- >validates(); $this->Tiposviajesusuario- >save($t); $t = null; } } I ran into a similar problem once. I was updating a meetings table, and I tried to do things like $this->data['Meeting']['date']. When I tried to save, I got errors. Changing it to $this->data['date'] fixed things for me. I hope that helps. hydra12 On Dec 3, 7:19 am, stefano <[EMAIL PROTECTED]> wrote: > Hello i'm using the las version of cakephp1.2 > > i have a problem with Model->save > > this is my source > --- > if(!empty($this->data)) { > foreach ($this->data["Tiposviajesusuario"] as $tipo) { > > $t["Tiposviajesusuario"]["usuario_id"] = $u["id"]; > $t["Tiposviajesusuario"]["tipo_id"] = > $tipo; > $this->Tiposviajesusuario->create(); > > $this->Tiposviajesusuario->validates(); > $this->Tiposviajesusuario->save($t); > $t = null; > } > } > > > i got this error > > Notice (8): Undefined index: tiposviajesusuario [CORE\cake\libs\model > \model.php, line 1093] > Warning (2): array_key_exists() [function.array-key-exists]: The > second argument should be either an array or an object [CORE\cake\libs > \model\model.php, line 1 > Notice (8): Undefined index: tiposviajesusuario [CORE\cake\libs\model > \model.php, line 1099] > Warning (2): array_keys() [function.array-keys]: The first argument > should be an array [CORE\cake\libs\model\model.php, line 1099] > > and the pr($t); > > is > > Array > ( > [Tiposviajesusuario] => Array > ( > [usuario_id] => 1 > [tipo_id] => 1 > ) > > ) > > i need help pls :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Save multipel posts at once
Here's a post on my blog that talks about saving several records to your database at once: http://www.ntatd.org/mark/?p=28 I hope that helps! hydra12 On Nov 22, 12:57 pm, laeffe <[EMAIL PROTECTED]> wrote: > I'm trying to create a page that will submit multipel posts for an > model. But i cant figure out how to do it the cake way.. any ideas > anyone? > > //Laeffe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Looking for an example with Extjs lib
OK, I now have an example to share. It's fairly long, so I won't post it here, but you can find it on my blog. http://www.ntatd.org/mark/?p=29 I hope that helps you some. If you have any questions, let me know. hydra12 On Nov 21, 5:19 pm, aniston <[EMAIL PROTECTED]> wrote: > Thankx Hydra, will wait for your examples, in the mean time have a > nice vacation wherever you are :) > ..aniston > > On 21 Nov, 15:41, hydra12 <[EMAIL PROTECTED]> wrote: > > > I have used extjs with cake a few times. I'll send you some examples > > later, but I'm on vacation right now and away from my dev. machine. > > > hydra12 > > > On Nov 21, 5:42 am, aniston <[EMAIL PROTECTED]> wrote: > > > > Hello, I found the edit-grid example of extjs very neat and was > > > looking for an example setup with cake if anyone has used this > > > alreadyhttp://extjs.com/deploy/dev/examples/grid/edit-grid.html > > > > Must admit i'm a new to AJAX and Javascript and risk a kicking from > > > the grus and pros who might dislike the asking for an example straight > > > out but I found it easier to "Learn by example" and then dig into the > > > code to suit it to my needs. > > > > On the practical end I tried including the ext-base.js, ext-core.js > > > and ext-all.js incl. the edit-grid.js libs with the default.thtml but > > > ended up with Ext is not defined errors (trying to recreate a working > > > sample of a standard 3x3 table) > > > > any help in howto start with this is appreciated. > > > > ciao, > > > aniston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Looking for an example with Extjs lib
I have used extjs with cake a few times. I'll send you some examples later, but I'm on vacation right now and away from my dev. machine. hydra12 On Nov 21, 5:42 am, aniston <[EMAIL PROTECTED]> wrote: > Hello, I found the edit-grid example of extjs very neat and was > looking for an example setup with cake if anyone has used this > alreadyhttp://extjs.com/deploy/dev/examples/grid/edit-grid.html > > Must admit i'm a new to AJAX and Javascript and risk a kicking from > the grus and pros who might dislike the asking for an example straight > out but I found it easier to "Learn by example" and then dig into the > code to suit it to my needs. > > On the practical end I tried including the ext-base.js, ext-core.js > and ext-all.js incl. the edit-grid.js libs with the default.thtml but > ended up with Ext is not defined errors (trying to recreate a working > sample of a standard 3x3 table) > > any help in howto start with this is appreciated. > > ciao, > aniston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: what is wrong , how can I fix it ,thank you very much
If you use debug() at all and have debugging on, you will get this error, too. On Nov 13, 1:42 pm, Gwoo <[EMAIL PROTECTED]> wrote: > your pagination component probably has some whitespace after the > closing tag ?>. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Display "Recent posts" lists in layout
I'd use an element with requestAction. You can find a tutorial on how to use them here: http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction Hope that helps. hydra12 On Oct 26, 2:34 pm, Adam Risser <[EMAIL PROTECTED]> wrote: > I have a section in my default layout (default.ctp) called "Recent > Posts". The posts are stored in my database. Currently, each method > in my posts controller includes the following code. > > # code snippet 1 > $fields = array('id', 'title'); > $this->set('data_for_layout', $this->Post->findAll(null, $fields, > null, 5)); > > Then I use this in my layout (default.ctp) to print out the posts > > #layout code snippet. > foreach($data_for_layout as $post) > { >echo ''. > $post['Post']['title'] . "\n"; > > } > > My problem is that I have to include the top code snippet in each > method to make it work this way, which seems wrong. I have been > trying to find a better way to do this in the manual, but am coming up > empty. Am I supposed to use elements or helpers to do this? Can I tie > those to the database somehow? Any help would be greatly appreciated > since I am new to cakePHP! Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Using Routes with Admin Routing
OK, finally got it for real: Router::connect('/admin/', array('prefix'=>'admin','controller' => 'tips', 'action' => 'index')); 'prefix'=>'admin' was the key. On Oct 25, 10:26 am, hydra12 <[EMAIL PROTECTED]> wrote: > OK, I was wrong. I grabbed the latest (pre-beta), then I grabbed the > latest from svn. It still doesn't work. Any thoughts? > > On Oct 25, 10:06 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > OK, found the answer > > here:http://groups.google.com/group/cake-php/browse_thread/thread/af135e46... > > > I should have spent more than 30 minutes looking for the answer . . . > > > On Oct 25, 9:43 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > > I'm working on a new app, and I'm having trouble with routes and admin > > > routing. I have a route setup for my non-admin users: > > > > Router::connect('/', array('controller' => 'tips', 'action' => > > > 'add')); > > > > This works great. When a user connects to my site, they automatically > > > go to the /tips/add page. > > > > I want to do the same thing for admin routing - setup a route that > > > directs /admin/ to /admin/tips/index. > > > > I can't get it to work correctly. I tried this: > > > > Router::connect('/admin/', array('controller' => 'tips', 'action' => > > > 'admin_index')); > > > > admin_index is considered private, so I can't call this function. Any > > > ideas? > > > > Thanks! > > > hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Using Routes with Admin Routing
OK, I was wrong. I grabbed the latest (pre-beta), then I grabbed the latest from svn. It still doesn't work. Any thoughts? On Oct 25, 10:06 am, hydra12 <[EMAIL PROTECTED]> wrote: > OK, found the answer > here:http://groups.google.com/group/cake-php/browse_thread/thread/af135e46... > > I should have spent more than 30 minutes looking for the answer . . . > > On Oct 25, 9:43 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > I'm working on a new app, and I'm having trouble with routes and admin > > routing. I have a route setup for my non-admin users: > > > Router::connect('/', array('controller' => 'tips', 'action' => > > 'add')); > > > This works great. When a user connects to my site, they automatically > > go to the /tips/add page. > > > I want to do the same thing for admin routing - setup a route that > > directs /admin/ to /admin/tips/index. > > > I can't get it to work correctly. I tried this: > > > Router::connect('/admin/', array('controller' => 'tips', 'action' => > > 'admin_index')); > > > admin_index is considered private, so I can't call this function. Any > > ideas? > > > Thanks! > > hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Using Routes with Admin Routing
OK, found the answer here: http://groups.google.com/group/cake-php/browse_thread/thread/af135e46e9acb355/93459541d5c568d9?lnk=gst&q=router+admin+routing#93459541d5c568d9 I should have spent more than 30 minutes looking for the answer . . . On Oct 25, 9:43 am, hydra12 <[EMAIL PROTECTED]> wrote: > I'm working on a new app, and I'm having trouble with routes and admin > routing. I have a route setup for my non-admin users: > > Router::connect('/', array('controller' => 'tips', 'action' => > 'add')); > > This works great. When a user connects to my site, they automatically > go to the /tips/add page. > > I want to do the same thing for admin routing - setup a route that > directs /admin/ to /admin/tips/index. > > I can't get it to work correctly. I tried this: > > Router::connect('/admin/', array('controller' => 'tips', 'action' => > 'admin_index')); > > admin_index is considered private, so I can't call this function. Any > ideas? > > Thanks! > hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 can I post a form to different controller/actions if the form has two submit buttons
AFAIK, you can't. You might get it to work this way, though: 1. Put a hidden field in your form. 2. Setup some javascript to populate the hidden field with either 'flag' or 'delete' depending on which button you click, then submit. 3. Setup your controller to perform different actions based on the contents of your hidden field. --OR-- 1. Use javascript to change the action of your form based on which button is clicked. I hope that helps. hydra12 On Oct 25, 7:51 am, Rahul <[EMAIL PROTECTED]> wrote: > Hi > I am working on a Animal Inventory System. > In a particular area of my application, I have a form with two submit > buttons say one for "Flag" and other for "Delete". > My problem is - "I have to post the form along with its data to the > flag action of say Animal controller when the user clicks the "Flag" > submit button (after checking one or more animals from a DB populated > list). > Similarly I want to post the same form to the Animals/delete action > when the user clicks the "delete" submit button after checking one or > more animals from a DB populated list. > > So how can I post the same form to different controller/actions > according to the click operation of respective submit button, if it > has two or more submit buttons. > > Please, if Can anyone help me out of this problem.. > > Regards > Rahul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Using Routes with Admin Routing
I'm working on a new app, and I'm having trouble with routes and admin routing. I have a route setup for my non-admin users: Router::connect('/', array('controller' => 'tips', 'action' => 'add')); This works great. When a user connects to my site, they automatically go to the /tips/add page. I want to do the same thing for admin routing - setup a route that directs /admin/ to /admin/tips/index. I can't get it to work correctly. I tried this: Router::connect('/admin/', array('controller' => 'tips', 'action' => 'admin_index')); admin_index is considered private, so I can't call this function. Any ideas? Thanks! hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: 400 Bad Request on Windows
I don't know if this will help or not. I'm working under the (possibly false) assumption that you are using an alias to make things work with your eclipse workspace (I tried that). I use eclipse and xampp (apache, etc) on windows xp sp2. I've had issues using an alias ( it was awhile ago, so I don't remember exactly what the problem was). Here's how I got things working. I know this doesn't fix your problem, but I'm pragmatic and just like to get things working. 1. I installed xampp into c:\web\xampp. 2. I made a folder called projects to put all my cake apps in and set my document root to c:\web\projects. 3. I set my eclipse workspace to c:\web\projects. Everything works. I hope that helps a little. hydra12 On Oct 23, 8:06 pm, JS Bournival <[EMAIL PROTECTED]> wrote: > I am unable to get Cake to work locally. I always get a HTTP 400 when > I hit the URL: > > http://localhost/csqv2(/) with or without trailing slash > > I'm using: > > WinXP > Apache 2.2 > PHP 5.2.3 > > I have a directory in my httpd.conf > > Alias /csqv2 "C:/dev/workspaces/ECLIPSEWorkspaces/csq/csqv2/" > > > Options Indexes FollowSymLinks > AllowOverride All > Order allow,deny > Allow from all > > > Also, I enabled logging for the mod_rewrite module, here is the output > it gave me: > > 127.0.0.1 - - [23/Oct/2007:20:37:43 --0400] [localhost/sid#26c6d8] > [rid#12beed0/initial] (3) [perdir C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/] strip per-dir prefix: C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/ -> > 127.0.0.1 - - [23/Oct/2007:20:37:43 --0400] [localhost/sid#26c6d8] > [rid#12beed0/initial] (3) [perdir C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/] applying pattern '^$' to uri '' > 127.0.0.1 - - [23/Oct/2007:20:37:43 --0400] [localhost/sid#26c6d8] > [rid#12beed0/initial] (2) [perdir C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/] rewrite '' -> 'app/webroot/' > 127.0.0.1 - - [23/Oct/2007:20:37:43 --0400] [localhost/sid#26c6d8] > [rid#12beed0/initial] (3) [perdir C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/] add per-dir prefix: app/webroot/ -> C:/dev/workspaces/ > ECLIPSEWorkspaces/csq/csqv2/app/webroot/ > 127.0.0.1 - - [23/Oct/2007:20:37:43 --0400] [localhost/sid#26c6d8] > [rid#12beed0/initial] (1) [perdir C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/] internal redirect with C:/dev/workspaces/ECLIPSEWorkspaces/ > csq/csqv2/app/webroot/ [INTERNAL REDIRECT] > > I really found this bug annoying ... especially when you think things > are gonna be simpler switching to CakePHP. I am aware that this bug > have been talked about in other posts, but no good solution have been > provided, can someone from the dev team answer it once and for all? > > Thanks in advance for your time. > Regards, > > JS. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: EXTJS forms, Cake, and AJAX
That did it! Thanks! On Sep 10, 1:28 pm, majna <[EMAIL PROTECTED]> wrote: > Sory : name form inputs like : data[User][first_name]; > > On Sep 10, 8:27 pm, majna <[EMAIL PROTECTED]> wrote: > > > name form inputs like : data[User][first:name]. > > or > > $this->data['User']['first_name] = $this->params['form'] > > ['first_name']; > > ... > > > On Sep 10, 8:15 pm, hydra12 <[EMAIL PROTECTED]> wrote: > > > > I'm trying to use the froms from EXTJS with cake. When my form posts, > > > this is what is in $_POST: > > > > [action] => submit > > > [last_name] => Buckner > > > [first_name] => Mark > > > > Nothing shows up in $this->data. How do I get it into this format? > > > > [data] => Array > > > ( > > > [User]=>Array > > > ( > > > [last_name]=>Buckner > > > [first_name]=>Mark > > > ) > > > ) > > > > This seems to be the format Cake expects. > > > > Thanks! > > > hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
EXTJS forms, Cake, and AJAX
I'm trying to use the froms from EXTJS with cake. When my form posts, this is what is in $_POST: [action] => submit [last_name] => Buckner [first_name] => Mark Nothing shows up in $this->data. How do I get it into this format? [data] => Array ( [User]=>Array ( [last_name]=>Buckner [first_name]=>Mark ) ) This seems to be the format Cake expects. Thanks! hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Path Clarification Please!?!?
I don't use the standard setup, but my understanding is that when you use the standard setup, the paths just work. When you move from one server to another, it should still just work. To make it work in the standard/public_html folder, you could copy everything from your cake folder on the development server and paste it into public_html on your shared server. I hope that helps. Somebody correct me if I'm wrong. hydra12 On Sep 9, 1:46 pm, DGPhoebus <[EMAIL PROTECTED]> wrote: > Hello everyone. I am new to CakePHP and I was wondering if the PATHS > have to be changed after a standard install? Also when moving from my > development server to the host (shared), will I have to change any of > the PATHS and is the standard layout okay for a shared server setup > with the document root pointing to the standard /public_html folder? > > I have seen so many "ways" to do this that I was wondering if there > was a standard setup to this. Thanks everyone. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Load Javascript on the fly
You can load scripts from within your views, too. I'm playing with ajax, jquery, and ext.js, and I had similar problems. Put something like this at the bottom of your view: link('myScript.js'); ?> NOTE - you have to but this at the bottom of the view. I tried putting it at the top, but the scripts never ran in IE. They worked in FireFox, though. Go figure . . . I hope that helps. hydra12 On May 25, 2:27 pm, "Pablo Viojo" <[EMAIL PROTECTED]> wrote: > I use to load javascript files on the fly using a **synchronous** connection > (using XMLHttpRequest) > > sUrl="http://example.com/scriptftoload.js";; > > if (window.XMLHttpRequest) { > xmlhttp = new XMLHttpRequest(); > if ( typeof xmlhttp.overrideMimeType != 'undefined') { > xmlhttp.overrideMimeType('text/xml'); > } > } else if (window.ActiveXObject) { > xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); > } else { > alert('Perhaps your browser does not support xmlhttprequests?'); > } > > xmlhttp.open('GET', sUrl, false); > xmlhttp.send(null); > > eval (xmlhttp.responseText); > > //some call to the loaded code > > Also, you can create a new
Re: halfcooked cake?
I don't think it's problem with your view. I deleted a view in one of my projects, and I got an error saying that the view for my controller couldn't be found. What I get when I look at your web page is the default cake setup. It basically says: "OK, cake is installed. Now build something." What is the name of your controller? You have to put the controller name into the URL. (http://coleg.homelinux.org/vColeg/controller name/ action). Right now, it's showing the default cake page because it doesn't know what controller to use. For instance, if I had a controller called UsersController, I'd put http://coleg.homelinux.org/vColeg/users/index, or http://coleg.homelinux.org/vColeg/users/add. Let me know what you find out. hydra12 On May 18, 4:19 am, Changoso <[EMAIL PROTECTED]> wrote: > the thing is I do have the controller set correctly.. i suppose > > what i cant seem to configure ollright is the views. > > tha baker is not making the add, edit or view.ctp in the view folder > > On May 17, 7:59 am, hydra12 <[EMAIL PROTECTED]> wrote: > > > What is the name of your controller? Most cake projects work like > > this:http://www.mysite.com/controller/action. You don't have to do > > it this way, but to change it you have to setup some routes, and it > > doesn't sound like you have. From what I can see on your site, you > > either don't have any controllers defined, or your project is not the > > document root of your web server. You might need to give the project > > name first:http://www.mysite.com/project/controller/action. This > > should only be necessary if you aren't using a standard cake install. > > > I hope that helps. > > > hydra12 > > > On May 16, 3:02 am, Changoso <[EMAIL PROTECTED]> wrote: > > > > Hey guys! > > > > I have just baked my project, but it didnt make any add, edit or view > > > archives, it only made the index.ctp. > > > > check, i dyndns so you can see it > > > > the address is: > > > >http://coleg.homelinux.org > > > > as you see if you go into > > > >http://coleg.homelinux.org/admins > > > > for example it will show you the empty db but I cant even add new > > > admins > > > > i tried copying and editng a file i had from a project a friend did > > > (the add.ctp) but i get an error > > > > you can try with tutors and you will get the same result, althugh that > > > doesnt has the add.ctp so if you try to go to /add it will not find > > > it. > > > > how can I fix this? or where could i get more help > > > > thx a lot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: halfcooked cake?
What is the name of your controller? Most cake projects work like this: http://www.mysite.com/controller/action. You don't have to do it this way, but to change it you have to setup some routes, and it doesn't sound like you have. From what I can see on your site, you either don't have any controllers defined, or your project is not the document root of your web server. You might need to give the project name first: http://www.mysite.com/project/controller/action. This should only be necessary if you aren't using a standard cake install. I hope that helps. hydra12 On May 16, 3:02 am, Changoso <[EMAIL PROTECTED]> wrote: > Hey guys! > > I have just baked my project, but it didnt make any add, edit or view > archives, it only made the index.ctp. > > check, i dyndns so you can see it > > the address is: > > http://coleg.homelinux.org > > as you see if you go into > > http://coleg.homelinux.org/admins > > for example it will show you the empty db but I cant even add new > admins > > i tried copying and editng a file i had from a project a friend did > (the add.ctp) but i get an error > > you can try with tutors and you will get the same result, althugh that > doesnt has the add.ctp so if you try to go to /add it will not find > it. > > how can I fix this? or where could i get more help > > thx a lot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Use php in js files?
I ended up assigning the variable to a js variable in my view. That worked great. Thanks! On May 12, 3:21 pm, Vladimir <[EMAIL PROTECTED]> wrote: > assigning js var is better because .js file can be cached --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Use php in js files?
I'm using jquery and ext.js to build a user interface. When a page loads, I have a ext.js menu loading at the top with new, edit and delete options. I want to click edit on the menu and have my page reload in editable form via ajax. Here's my problem: the new button works fine, but I can't get my edit button to work. How can I pass the page's id from php to javascript? Here's what I have, and it won't work since it's being loaded from a js file: $("#center1").load('/transportation/tickets/edit/id;? >'); Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get List of Plugins
Thanks, gwoo! On Apr 27, 5:20 am, gwoo <[EMAIL PROTECTED]> wrote: > uses('folder'); > $Plugins = new Folder(APP.'plugins'); > pr($Plugins->ls()); > > Something like this should work. > good luck. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Get List of Plugins
Does anybody know a way to get a list of which plugins are in the plugins directory? I'm playing around with the idea for an application that would use lots of plugins, and I want to dynamically add them to a menu at runtime. Thanks! hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: is there another Star Rating code or helper to cake ?
Here's one: http://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/ On Apr 23, 8:16 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > Cheesecake-Photoblog SVN has a working example which uses JQuery and > works well with latest 1.1.x cake version - See demo > athttp://cheesecake-photoblog.org/demo/ > > HTH > Tarique > > -- > = > PHP for E-Biz:http://sanisoft.com > Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org > = > > On 4/23/07, fredBH <[EMAIL PROTECTED]> wrote: > > > > > Hello guys... how r u ? > > > I have trying to > > usehttp://rossoft.wordpress.com/2006/09/07/ajax-star-rating-helper/ > > withou sucess... > > > Its to complicate and i can understand the user's posts about how to > > use it... > > > So... is there another way ? > > or can someone send me and fully usefull example of rossoft Star > > Rating code ? > > > Thx to all > > > Bye --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 manage URLs that doesn't require access to Database
You can put static pages in the webroot folder. For instance, you could put a folder in webroot called cpanel. Put an index.html page in cpanel, and access it by going to www.mysite.com/cpanel. That worked on my system, so it should work . . . I hope that helps. hydra12 On Apr 23, 5:56 am, 浪漫様 <[EMAIL PROTECTED]> wrote: > Dear CakePHP users, > I'm a newbie on CakePHP and now i'm building my first site on CakePHP > due to my boss requirements... the problem is that CakePHP seems to be > quite usefull for pages that requires data from a DB and the URLs are > created in order to simplifly the old mysql queries... but... how can > i use CakePHP for pages that doesn't require any DB info? for example, > a basic "About" page... and the most important, if i want to create a > ControlPanel for administration... how can i build the link > "http://www.mysite.com/cpanel";? as cpanel is not a model neither a table on my > DB... just wished a cpanel folder to keep my administration files > organized and the corresponding DB oriented pages inside it > "http://www.mysite.com/cpanel/users/new"; > I hope some of you can explain me a little more how to perform those > actions, shouldn't be so complicated, but is starting to begin a pain > in the ass wondering how to use non DB pages and how to organize the > URLs with your desired pattern instead of the default CakePHP URLs. > Thank you very much, > > Rohman :: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: scaffold in admin
I'm not sure if I understand exactly what you want, but here goes: if you want to scaffold your admin_ views but not any of your other views, I don't think you can (officially). When you scaffold a controller, it scaffolds everything (I think). What you can do is use bake to create your basic controllers and views. This builds the scaffolding for you, and you can then modify the code. I hope that helps. hydra12 On Apr 19, 12:07 pm, LLoBu <[EMAIL PROTECTED]> wrote: > I´m using CAKE_ADMIN to protect admin scaffold. > > I don´t know how to use in, for example: > > class Travels_Controller extends AppController { > function index(){ > // show all travels > } > > function show_one($id){ > // controller to show one travel > } > > function admin_travels(){ > // here i´d like scaffolding > } > > } > > I´m wasting a lot of time trying to scaffold inside an admin method, I > hope someone would help me to do this and other sections like fly > tickets and another. > > That´s my opinion, but I´m openmind to other solutions, because it´s > simple, I just need to show three sections and administrator to > scaffold them. > > Thanks to everyone. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: whats the relationship between CakePHP 1.2 test suite N SimpleTest
I may be wrong, but I think it works like this: The cake testsuite (and cakebaker's) are wrappers for simpletest. Simpletest is used as a vendor, and the testsuite 'cake-ifies' it. (Is that a word? Probably not . . .) Anyway, simpletest is doing the actual testing, but the test suite makes everything work in a cakey way (loading models, controllers, etc). I hope that helps. Somebody please correct me if I'm wrong. hydra12 On Apr 16, 5:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > whats the relationship between CakePHP 1.2 test suite N SimpleTest? > > is test suite new feature of the 1.2 ? and does test suite just use > SimpleTest as fundamental? > and when you download and put SimpleTest in right place ,it enable the > test suite?? > > and when use bake.php ,it seems like it output test for SimpleTest not > cakephp test suite .but why ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Proposal for "killer app"
I think that's the best idea I've read in this entire thread! On Mar 29, 9:00 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 3/29/07, digital spaghetti <[EMAIL PROTECTED]> wrote: > > > > > What I am now proposing, through the thoughts that you have all > > expressed here, is to build standard "modules" of code that people can > > use in their projects. > > Nate and I had been talking about this very thing yesterday on IM, > where what is really needed is a commitment to a plugin architecture, > so that ideas (such as standard "user authentication" modules) can > start out as plugins external to the framework, then if they are > effective enough they can be moved into the core. Ruby on Rails uses > this to great effect and there is absolutely no reason why we > shouldn't be stealing that idea and using it ourselves. > > Perhapshttp://plugins.cakephp.orgshould spring into being, with an > explanation of how plugins work and documentation on how to actually > create a plugin. > > -- > Chris Hartjes > > My motto for 2007: "Just build it, damnit!" > > rallyhat.com - digital photo scavenger hunt > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Testing Plugins
I'm just starting out with testing, so I don't have a lot of experience to draw from, but I think the best way to test a plugin would be to put the tests and the db-config into the plugin folder. That would be in keeping with the concept that a plugin is a mini-app that can be dropped into an existing application. On the other hand, plugins share images,css, js, etc. with their containing app, so you could probably make a case for putting your tests into the app test folder, and using the app's config settings. I prefer the first option, but like I said, I don't have a lot of experience with this yet. hydra12 On Mar 27, 12:38 pm, "Daniel Hofstetter" <[EMAIL PROTECTED]> wrote: > Well, testing of plugins is not (yet) implemented. What do you think > would be the best approach to test plugins? > > -- > Daniel Hofstetterhttp://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Testing Plugins
I'm playing with CakeBaker's test suite. Does anybody know if you can use it to test plugins? Right now, it only sees tests in my app/tests folder, not in plugins/pluginName/tests. When I put my tests in app/ tests, I get an error because it can't find my models/controllers/etc. Anybody have any suggestions? Thanks! hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: newbie question, populate drop down box from other parent table
In your category model, put this: var $displayField = 'name'; Name is the name of the db field you want to show instead of the id. Hope that helps! hydra12 On Mar 19, 5:48 pm, "sixlaneve" <[EMAIL PROTECTED]> wrote: > Hi... sorry... I am a bit thick and I have a problem with this > dropdown. > > It works OK, just in the dropdown it shows only the category ID and > not the category name any idea? (I did exactly as cc96i post) :F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: help with windows install needed - php\php.exe instead of cake ROOT[Scanned]
If you find out what's wrong, please post it here so I can see what happened. I'll be away from my computer for about a week - it's spring break in Texas, and I'm taking my youth group on a trip - but I'll check it when I get a chance. hydra12 (Mark) On Mar 9, 1:20 pm, "jyrgen" <[EMAIL PROTECTED]> wrote: > Thanks Mark, > > i'll try out what you suggested. In the meantime i've put the app > on a remote server and check it there. > But i'm too curious about what might causing this, and i wouldn't > be the first time that trace the code, my way of contribution to > this fantastic framework. > i'll let guys know.. > jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: help with windows install needed - php\php.exe instead of cake ROOT
I'm assuming (from your comment about putting it on your windows partition) that you first tried this on linux or osx? Did it work there? Also, define your root this way: define('ROOT', 'e:'.DS.'programs'.DS.'apache'.DS.'htdocs'.DS.'cake'); DS is a constant that takes care of using \ or /. I've had some problems when I hard-coded it like you have. If that doesn't help, I'll be glad to try to work with you. Please note, though, that I can only help if I'm online when you post(which isn't all that often if things are busy at work). Try to be patient. I can understand being frustrated when you ask for help and don't get it as fast as you'd like (I've been there, too), but getting snippy doesn't help anything :-) hydra12 On Mar 8, 6:11 pm, "jyrgen" <[EMAIL PROTECTED]> wrote: > ok guys, > i will track this down, > thanks for yr help :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Installation Problem -- Need Help!!!
I could be wrong, but it sounds like cake is having trouble finding your posts_controller.php. I'm assuming that it's in cake/app/ controllers/posts_controller.php? The class should be class PostsController extends AppController. Is that what you have? It might help if you could put your code up someplace so we could look at it. On Mar 7, 12:55 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > It's the default structure that comes directly out of the cake box. I > never changed it. > Is it what you need? > Thanks a lot! > > On Mar 7, 1:40 pm, "hydra12" <[EMAIL PROTECTED]> wrote: > > > What is your current directory structure? That would help in > > diagnosing your problem. > > > On Mar 7, 12:06 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > Yes, thank you for the reply! I have succesfully installed Cake now. > > > I followed the online example of Blog and created the DB and the code. > > > But when I tried to connect to it, I got this fatal error: > > > > Fatal error: Class 'PostsController' not found in /usr/local/apache2/ > > > htdocs/cake/cake/dispatcher.php on line 158 > > > > I did change the routes.php file like this: > > > > // $Route->connect('/', array('controller' => 'pages', 'action' > > > => 'display', 'home')); > > > $Route->connect ('/', array('controller'=>'posts', > > > 'action'=>'index')); > > > > The Dir root for the cake on the server is: > > > /usr/local/apache/htdocs/cake > > > > (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) > > > > I have no clue about what is wrong with the code now since I am really > > > a freshman in the bakery. > > > > Thanks a lot! > > > > On Mar 7, 11:23 am, "Christopher E. Franklin, Sr." > > > > <[EMAIL PROTECTED]> wrote: > > > > You are going to have to read the installation instructions again all > > > > the way through as well as the manual onwww.cakephp.org > > > > > On Mar 7, 7:46 am, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > > > Thank you, guys, for your help! > > > > > I just changed it to the dev installation and it works as it is. > > > > > But when I opened the default page in a browser, it said: > > > > > > "Your database configuration file is not present." > > > > > > Do you know what it refers to? > > > > > > Thanks a lot! > > > > > S. > > > > > > On Mar 6, 8:51 pm, "hydra12" <[EMAIL PROTECTED]> wrote: > > > > > > > I don't know what your setup is like, but I explained to someone > > > > > > else > > > > > > how I do my alternative setup > > > > > > here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... > > > > > > > I have a cake folder and an app folder inside my server's document > > > > > > root (htdocs for most people, it seems). I only had to change 1 > > > > > > line > > > > > > in my app's webroot/index.php file to make it work. I hope it > > > > > > helps. > > > > > > > hydra12 > > > > > > > On Mar 6, 3:53 pm, "Christopher E. Franklin, Sr." > > > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > I uploaded my bootstrap and core.php to the files section of this > > > > > > >group:http://groups.google.com/group/cake-php/files?hl=en > > > > > > > > The only thing I have changed in core.php was the DEBUG and the > > > > > > > CAKE_SESSION_SAVE' parts. > > > > > > > > Change define('CAKE_SESSION_SAVE', 'database'); to > > > > > > > define('CAKE_SESSION_SAVE', 'php'); after you donwload it. > > > > > > > > If you still get errors about require() your installation may be > > > > > > > corrupt. Try and re-download the latest version > > > > > > > fromwww.cakephp.org > > > > > > > > On Mar 6, 1:07 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > > > > > > I just installed theCakePHPon the Apache 2.0 with PHP 5. I used > > > > > > > &g
Re: Installation Problem -- Need Help!!!
What is your current directory structure? That would help in diagnosing your problem. On Mar 7, 12:06 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > Yes, thank you for the reply! I have succesfully installed Cake now. > I followed the online example of Blog and created the DB and the code. > But when I tried to connect to it, I got this fatal error: > > Fatal error: Class 'PostsController' not found in /usr/local/apache2/ > htdocs/cake/cake/dispatcher.php on line 158 > > I did change the routes.php file like this: > > // $Route->connect('/', array('controller' => 'pages', 'action' > => 'display', 'home')); > $Route->connect ('/', array('controller'=>'posts', > 'action'=>'index')); > > The Dir root for the cake on the server is: > /usr/local/apache/htdocs/cake > > (The defaulty wwwroot is /usr/local/apache/htdocs for that server.) > > I have no clue about what is wrong with the code now since I am really > a freshman in the bakery. > > Thanks a lot! > > On Mar 7, 11:23 am, "Christopher E. Franklin, Sr." > > <[EMAIL PROTECTED]> wrote: > > You are going to have to read the installation instructions again all > > the way through as well as the manual onwww.cakephp.org > > > On Mar 7, 7:46 am, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > Thank you, guys, for your help! > > > I just changed it to the dev installation and it works as it is. > > > But when I opened the default page in a browser, it said: > > > > "Your database configuration file is not present." > > > > Do you know what it refers to? > > > > Thanks a lot! > > > S. > > > > On Mar 6, 8:51 pm, "hydra12" <[EMAIL PROTECTED]> wrote: > > > > > I don't know what your setup is like, but I explained to someone else > > > > how I do my alternative setup > > > > here:http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2... > > > > > I have a cake folder and an app folder inside my server's document > > > > root (htdocs for most people, it seems). I only had to change 1 line > > > > in my app's webroot/index.php file to make it work. I hope it helps. > > > > > hydra12 > > > > > On Mar 6, 3:53 pm, "Christopher E. Franklin, Sr." > > > > > <[EMAIL PROTECTED]> wrote: > > > > > I uploaded my bootstrap and core.php to the files section of this > > > > >group:http://groups.google.com/group/cake-php/files?hl=en > > > > > > The only thing I have changed in core.php was the DEBUG and the > > > > > CAKE_SESSION_SAVE' parts. > > > > > > Change define('CAKE_SESSION_SAVE', 'database'); to > > > > > define('CAKE_SESSION_SAVE', 'php'); after you donwload it. > > > > > > If you still get errors about require() your installation may be > > > > > corrupt. Try and re-download the latest version fromwww.cakephp.org > > > > > > On Mar 6, 1:07 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > > > > I just installed theCakePHPon the Apache 2.0 with PHP 5. I used the > > > > > > Alternative installation on theCakePHPmanual. > > > > > > However, when I tried to connect to the default page on a web > > > > > > browser, > > > > > > I got this error message: > > > > > > > "Warning: require(config/core.php) [function.require]: failed to > > > > > > open > > > > > > stream: No such file or directory in > > > > > > /usr/lib/cake/cake/bootstrap.php > > > > > > on line 34 > > > > > > > Fatal error: require() [function.require]: Failed opening required > > > > > > 'config/core.php' > > > > > > (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ > > > > > > usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34" > > > > > > > What might cause the problem? (I have set up the path in index.php > > > > > > file following the instructions on the manual.) > > > > > > > Thanks a lot!- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Installation Problem -- Need Help!!!
I don't know what your setup is like, but I explained to someone else how I do my alternative setup here: http://groups.google.com/group/cake-php/browse_thread/thread/8f96dbb2bc3a9557/bd341672e9029bd8#bd341672e9029bd8 I have a cake folder and an app folder inside my server's document root (htdocs for most people, it seems). I only had to change 1 line in my app's webroot/index.php file to make it work. I hope it helps. hydra12 On Mar 6, 3:53 pm, "Christopher E. Franklin, Sr." <[EMAIL PROTECTED]> wrote: > I uploaded my bootstrap and core.php to the files section of this > group:http://groups.google.com/group/cake-php/files?hl=en > > The only thing I have changed in core.php was the DEBUG and the > CAKE_SESSION_SAVE' parts. > > Change define('CAKE_SESSION_SAVE', 'database'); to > define('CAKE_SESSION_SAVE', 'php'); after you donwload it. > > If you still get errors about require() your installation may be > corrupt. Try and re-download the latest version fromwww.cakephp.org > > On Mar 6, 1:07 pm, "Somewhere" <[EMAIL PROTECTED]> wrote: > > > > > I just installed the CakePHP on the Apache 2.0 with PHP 5. I used the > > Alternative installation on the CakePHP manual. > > However, when I tried to connect to the default page on a web browser, > > I got this error message: > > > "Warning: require(config/core.php) [function.require]: failed to open > > stream: No such file or directory in /usr/lib/cake/cake/bootstrap.php > > on line 34 > > > Fatal error: require() [function.require]: Failed opening required > > 'config/core.php' (include_path='/usr/lib/cake:/home/ywang/cakephp/:.:/ > > usr/local/lib/php') in /usr/lib/cake/cake/bootstrap.php on line 34" > > > What might cause the problem? (I have set up the path in index.php > > file following the instructions on the manual.) > > > Thanks a lot!- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Admin Routing Redirect problem
I fixed this one myself. I'm still not sure if this is the best way to do things, but here's how I got it to work: In my controller, in beforeFilter(), I set a session variable called auth.page. It's value is set with this code: $temp = str_replace("url=","/",$_SERVER['QUERY_STRING']); $this->Session->write('auth.page', $temp); In my auth plugin, I check to see if auth.page == '', and if it does, I set it to '/'. Now I do my redirects to auth.page. When you call $_SERVER['QUERY_STRING'] on a page where you don't give the controller/action (in routes I have / set to tickets/add/), Query_String comes back blank, so I set it to '/', which make the redirect work without errors. BTW, I did the str_replace above because $_SERVER['QUERY_STRING'] prefaces everything with url= . On Mar 6, 11:01 am, "hydra12" <[EMAIL PROTECTED]> wrote: > I'm working on a plugin for acl and authentication. When someone goes > to a page, if they haven't logged in yet, they are redirected to my > authentication plugin. When they successfully authenticate, they are > redirected back to the original page they tried to view. To do this, > when they are redirected to the auth page, I also pass the controller > and action. Redirecting back to the original page works fine EXCEPT > when the original page is an admin page. The controller gets passed > as admin_index. On redirect, they end up at /tickets/admin_index/ > instead of /admin/tickets/index, which doesn't work. > > I understand why this is happening. Anybody have a suggestion on how > I can fix it, or maybe a better way to redirect back to the calling > page? > > Thanks! > hydra12 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---