Baked views and hasOne / belongsTo relationship
Hi there Bakers -- I have two tables that are joined via a belongsTo and hasOne relationship. When I bake my views for the "parent" table...none of the "child" table fields show up in the index or edit screens... If I look at the generated SQL, the relationships work and when pasted into a db...all the data from both tables comes back as one row...just isn't displayed on the index or edit pages. Also, I can manually get the fields to show and display data from the database but I am wondering why cake bake isn't putting the data into the view by default...I wonder about this because a previous version of cake did in fact do this... Is there any way to force cake bake to include this child table fields in the generated views of the parent? Obviously, I can add them myself but if I can get cake bake to do it for me, all the better. Many thanks! -- View this message in context: http://www.nabble.com/Baked-views-and-hasOne---belongsTo-relationship-tp15423574p15423574.html Sent from the CakePHP mailing list archive at Nabble.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: What variable can I modify so that links, css, and jss don't have index.php in them?
Thank you so much for pointing out what should have been obvious! Went into app_controller.php and modified $this->webroot and all was well! Many thanks, Sam! Sam Sherlock wrote: > > I have copied this from a freshly baked app default.ctp > > type="image/x-icon" /> > > > when not using mod write you get > > type="image/x-icon" /> > > On 04/01/2008, loki_mdog <[EMAIL PROTECTED]> wrote: >> >> >> >> I am look for a the file and the variable to go into so that my css and >> js >> links aren't lead off with: >> /index.php >> >> For example, >> /index.php/favicon.ico >> >> baseURL is commented out. >> >> Many thanks! >> >> >> -- >> View this message in context: >> http://www.nabble.com/What-variable-can-I-modify-so-that-links%2C-css%2C-and-jss-don%27t-have-index.php-in-them--tp14626892p14626892.html >> >> Sent from the CakePHP mailing list archive at Nabble.com. >> >> >> > >> > > > > > -- View this message in context: http://www.nabble.com/What-variable-can-I-modify-so-that-links%2C-css%2C-and-jss-don%27t-have-index.php-in-them--tp14626892p14672390.html Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
What variable can I modify so that links, css, and jss don't have index.php in them?
I am look for a the file and the variable to go into so that my css and js links aren't lead off with: /index.php For example, /index.php/favicon.ico baseURL is commented out. Many thanks! -- View this message in context: http://www.nabble.com/What-variable-can-I-modify-so-that-links%2C-css%2C-and-jss-don%27t-have-index.php-in-them--tp14626892p14626892.html Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Index.php showing up in URLs
So I have my codebase set up in my dev environment working just swell (using IIS6 and Helicon Rewrite). Pretty URLs working great...sorting and pagination work perfectly (using 1.2x). I move the code to production and all is sort of OK except pretty URLS are not being used (causing the CSS to break and all the links to be farked up). For example: /index.php/controller_name/ when it should be /controller_name/ App.baseUrl is commented out of core.php //Configure::write('App.baseUrl', env('SCRIPT_NAME')); Incidentally, when I uncomment it I get this error: Warning (2): Invalid argument supplied for foreach() [CORE\cake\libs\configure.php I have mod_rewrite working and my rules that work on my other server for the .htaccess are: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] Any other places to look or what variable can I tweak to get rid of the index.php from the URLs for links, css, and js? Many thanks! -- View this message in context: http://www.nabble.com/Index.php-showing-up-in-URLs-tp14609106p14609106.html Sent from the CakePHP mailing list archive at Nabble.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: Paginating search results, keeping search criteria, and not messing with the view
Hey Robert... Been out of town...I'll try to post my entire view and controller code so you can see... -- View this message in context: http://www.nabble.com/Paginating-search-results%2C-keeping-search-criteria%2C-and-not-messing-with-the-view-tf4899190.html#a14136056 Sent from the CakePHP mailing list archive at Nabble.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: Paginating search results, keeping search criteria, and not messing with the view
It's not that I am against it and I will use this line if I have to but it doesn't make sense to me to include it in the view. I am defining everything else about the pagination in the controller (including my filtering logic)...seems to make sense to me that I should be able to retain that filtering logic at the controller level and not the view. If it can't be done, then it can't be done...just curious as I am having a hard time finding examples that work this way. Many thanks! -- View this message in context: http://www.nabble.com/Paginating-search-results%2C-keeping-search-criteria%2C-and-not-messing-with-the-view-tf4899190.html#a14035093 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Paginating search results, keeping search criteria, and not messing with the view
Hey Folks, I have got paginating search results working...PERFECTLY!!! Took me long enough...anyway, I would like the have the pagination remember the filter terms (as it currently does) without having to make any modifications to the view. The code is here and listed a cakephp's bin (URL below): VIEW: this line makes the pagination URLs contain filters I need options(array('url' => $this->passedArgs));?> I want to remove the line above and get it in the controller and am combing the internets for an answermany thanks. CONTROLLER function index() { $this->UserAction->recursive = 0; // holds the keyword filter $filter = ""; // holds the conditions that should filter by $conditions = array(); // filter by the data that is in the url string if(isset($this->passedArgs['param_filter'])){ $filter = $this->passedArgs['param_filter']; } // filter by the data in the form field if($this->data['UserAction']['filter']){ $filter = $this->data['UserAction']['filter']; } // set the data from the form field as something that will be in the url // so when URLs are constructed on the view, the filter will be there $this->passedArgs['param_filter'] = $filter; // do we have data to filter by if($filter){ // if so, let's add this to the conditions array $conditions = array("UserAction.action = '$filter'"); } // pagination criteria to filter by $this->paginate['UserAction'] = array( 'limit' => 10, 'order' => array ('UserAction.id' => 'asc'), 'conditions' => $conditions //'url' => array ('url' => 'testme') ); // the result sets $this->set('userActions', $this->paginate()); // pass the paramters to the view $this->set('param_filter', $filter); } http://bin.cakephp.org/view/602487164 http://bin.cakephp.org/view/602487164 -- View this message in context: http://www.nabble.com/Paginating-search-results%2C-keeping-search-criteria%2C-and-not-messing-with-the-view-tf4899190.html#a14032399 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Does paginate work in 1.2? Going to any other page brings up page one results
So if I pull up the first page, then click to any of the other pages via the next or number links, it just pulls up the first page results (though, it says it is on page 2 displaying results 11 - 20). The URL for page 2 is: /cake/seo_schools/index/page:2 However, if I first sort the table on the first page by clicking a header and THEN paging to the next page, things work as they should. The url then is: /cake/seo_schools/index/page:2/sort:school_id/direction:asc Does this sound familiar to anyone? Ideas? Many thanks! Controller: function index() { $this->SeoSchool->recursive = 0; $this->set('seoSchools', $this->paginate()); } View: prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> | numbers();?> next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> -- View this message in context: http://www.nabble.com/Does-paginate-work-in-1.2--Going-to-any-other-page-brings-up-page-one-results-tf4885700.html#a13984134 Sent from the CakePHP mailing list archive at Nabble.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: Where do the templates for default views live -- not the ones in the scaffolds dir
So I did some more searching and found that there are no templates for this stuff...The files are generated straight out of bake.php...Views are created by a method called: __bakeViews Hope this helps someone else. -- View this message in context: http://www.nabble.com/Where-do-the-templates-for-default-views-livenot-the-ones-in-the-scaffolds-dir-tf4655647.html#a13303328 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Where do the templates for default views live -- not the ones in the scaffolds dir
I want bake.php to create my controller with default actions baked in (index, edit, add, etc) and I want bake.php to create my views for these actions as well. All works great. I want to change the template it uses for say the index so I can add something to all index.thtml files that are baked so I make a change to: \cake\cake\libs\view\templates\scaffolds\index.thtml and re-run baking the view and the view is NOT CHANGED...nothing I put in that template is displayed. If I bake the controller so all it does is use scaffolding, it then reads the template I mention above and everything shows up. I want to know where the template is read from when you bake your controller and view so that the functions and view are explicitly put in the controller. Where does that view template live? I have searched all the entire codebase for something that is in the index.thtml that is generated and I find in the file I mention above but changing that file doesn't change the index.thtml that gets baked. Any insight would be appreciated!!! -- View this message in context: http://www.nabble.com/Where-do-the-templates-for-default-views-livenot-the-ones-in-the-scaffolds-dir-tf4655647.html#a13302623 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Default form elements for data types
Is there any URL out there that lists the different form elements that are generated via scaffolding or bake.php for given data types out of the database? Will any ever be radio buttons? Thanks, Matt -- View this message in context: http://www.nabble.com/Default-form-elements-for-data-types-tf4438904.html#a12665007 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---