Re: request for a tutorial
Hey Bingo, I cannot point you to a tutorial (but I am sure something is there on the wiki). To answer your problem (to which there can be many approaches), I can take one example - Suppose you have a form which has the following fields - Username Password Email Age Country Postal Code The first 3 need to be entered into the 'users' table and then next three into the 'profiles' table. Name the first 3 input types as User/fieldname & the other 3 as Profile/fieldname just like you would do when you are entering data into only one table. So, now when the user submits the form, you'll have something in the User array & something in the profile array. You can now make use of something called requestAction() to invoke a method in another controller. So, for eg, if you did a submit to the users controller (form action being /users/add), then in that controller you could try to access the Users array and pass it to the save method. Once the data is saved in the users table, you want to know add the profile data to the profile table-right? For this inside the add method of users controller, you could check if save was successful then call - $this->requestAction('/profiles/add', array()); Using the above you are calling the add method of the profiles controller from the users controller. The second argument is the array of values you want to pass to the add method of the profiles controller. Now, in the profiles controllers's add method, you can grab the profile array (passed by the form earlier) and call the save method. Not the most optimum or best of examples (as I too am new to cake), but I think this should get you started. Drop me a line if this helped you :) Regards, Mandy. bingo wrote: > Hello all bakers, > > First, I would like to thanks all bakers for creating an excellent > framework and also interesting and detailed tutuorials to get started > with CakePHP. Especially, I had lot of fun and I was excited to see how > within minutes a working application can built using scaffolding > > But as I am making progress, I am realizing lack of some important > tutorials. Mainly that can tell how to build a form (view) and a > controller (controller) that can insert/update data into multiple > tables using models. I tried to gather relevant information using > manual, irc, CakePHP group, and google search, but I having a hard time > in putting all the things together. Probably, its lack of my programing > experience and familiarity with PHP and to some extent lack of time. > > I would much appreciate if some baker can build a tutorial on how to > build a form(view) and a controller to insert data into multiple > tables. This seems to be a common problem with many novice baker. > > Regards > Bingo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
problems using php include() within cakephp
Hi, I am totally new to cakephp and I am tearing my hair out! I finally figured out that I could put non-cake files in the webroot folder - so far so good. Then I decided to start breaking up my files into smaller templates - that's when things started to go wrong. because I have several sites under development on my machine, my doc root as far as apache is concerned is c:/www, and I have virtual sites with roots at: c:/www/site1 c:/www/site2 etc. So say I am working on site 1. My webroot as far as cake is concerned is: c:/www/site1/webroot. 1) I then went into my httpd conf and made sure there was a entry for c:/www/site1 with allowoverride set to ALL and restarted apache. 2) moved my files into c:/www/site1/webroot, and everything worked. 3) decided I should start using sub-templates for common sections of my webpages. pulled out headers and footers and stuck them in a folder I created at c:/www/site1/webroot/common. started using include() calls to reinclude them into the pages: Doesn't work! I get warnings like: Warning: main() [function.include]: Failed opening 'C:/www/mysite/webroot/common/header.php' for inclusion (include_path='.;C:\php5\pear') in C:\www\mysite\app\webroot\foo\bar.php on line 3 can anyone pls help explain this behaviour?! many thx 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 -~--~~~~--~~--~--~---
request for a tutorial
Hello all bakers, First, I would like to thanks all bakers for creating an excellent framework and also interesting and detailed tutuorials to get started with CakePHP. Especially, I had lot of fun and I was excited to see how within minutes a working application can built using scaffolding But as I am making progress, I am realizing lack of some important tutorials. Mainly that can tell how to build a form (view) and a controller (controller) that can insert/update data into multiple tables using models. I tried to gather relevant information using manual, irc, CakePHP group, and google search, but I having a hard time in putting all the things together. Probably, its lack of my programing experience and familiarity with PHP and to some extent lack of time. I would much appreciate if some baker can build a tutorial on how to build a form(view) and a controller to insert data into multiple tables. This seems to be a common problem with many novice baker. Regards Bingo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Re: has many through associations
you mean like $this->ModelName->AssociatedModel->findAll($condition); You can do that On 9/1/06, Evan <[EMAIL PROTECTED]> wrote: > > you misunderstand me. i am already too familiar with the four regular > associations. what i'm looking for is a way of making associations > THROUGH an intermediary association. read this in rails: > http://wiki.rubyonrails.org/rails/pages/ThroughAssociations > > > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost 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 -~--~~~~--~~--~--~---
Re: Help with HABTM!
how about making use of the beforeSave() callback in User model: function beforeSave() { $this->data['Role']['Role'] = ; } voila! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: has many through associations
you misunderstand me. i am already too familiar with the four regular associations. what i'm looking for is a way of making associations THROUGH an intermediary association. read this in rails: http://wiki.rubyonrails.org/rails/pages/ThroughAssociations --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: open_basedir restriction in effect Help Needed
Hi Ray, I have been trying to get it to work defining many values for ROOT but no matter what I do I get the same error. My app is hosted in this path var/www/vhosts/begreennow.com/httpdocs/webapp The folder structure inside webapp is the standard. Is there anyway to make cakephp include 'bootstrap.php', etc without having to read the file from the root? Thanks, Sebastian MJ Ray wrote: > Sebastian Macias <[EMAIL PROTECTED]> wrote: > > Warning: main() [function.main]: open_basedir restriction in effect. > > File(/cake/bootstrap.php) is not within the allowed path(s): > > For whatever reason, it sounds like cake can't figure out its starting > directory in order to locate the cake sibling of app. You could try > setting the define()s in app/webroot/index.php to be the actual path > string instead of the functions on __FILE__. > > Hope that helps, > -- > MJ Ray <[EMAIL PROTECTED]> www.ttllp.co.uk +44-870-4321-9-10 > Web, localisation, koha, databases, GNU/Linux and statistics. > Registered in England and Wales, partnership number OC303457 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Model::read() : fetch the first level with conditional argument
Hi all, I have the following model objects: MailList hasManyAndBelongsTo Email The Email object has an "active" boolean attribute. In the page that shows the details of a MailList and wanted to list only the active Emails of that MailList. If I use MailList::read(null, $id), then I get all Emails in the resulting query. How is a good way to solve this? Do I need to write a specific SQL query and use query() to get only the active Emails from a MailList?? Or is there a MailList->someMethod() that I can use? Tks Felipe --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
send free anonymous sms to any mobile in the world
send free anonymous sms to any mobile in the world features1-Send Free Messages Worldwide!2-Send anonymous - spoofed messages!3-Worldwide Coverage 4-User friendly interface5-Advanced Support to sign up http://www.pimpmysms.com/in.php?id=drbassam84 -- DigitalPerson --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How can I add admin directory under cakephp framework?
There is no sound in this version, something happened when I published it and the sound was not included, but I will republish later with sound. You should be able to follow along though. http://cakephp.org/screencasts/view/5 -- /*** @author Larry E. Masters* @var string $userName* @param string $realName* @returns string aka PhpNut* @access public*/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: has many through associations
http://manual.cakephp.org/chapter/models Scroll down to Section 4: Associations. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How can I add admin directory under cakephp framework?
There's other ways to do this, depending on whether you'd rather keep all your admin functionality in one place or to separate it out into the other controllers. If you want to separate it out, you can enable admin routes - search for more information on that if you want to go that way. To keep it together... Don't create the admin subdirectory. Instead, create an AdminController, with an action "dashboard". The correct Route for that would be: $Route->connect('/admin/', array('controller' => 'admin', 'action'=>'dashboard')); This might not be 100% correct, and as I haven't implemented the admin section of my own application yet, I can't confirm it for you. But it should get you to the dashboard at least, and from there you can link to the other files. In fact you shouldn't technically even need to modify the Routes to get to it if you do it this way, you could just make your 'dashboard' in AdminController/index. Hope this helps... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Form elements by Html helper without a model
Hi all Is it possible in Cake to generate HTML form elements with the HTML helper but not have those elements related to any Model or field? For example a select tag for filtering a list or a checkbox for confirming delete. I'm finding that if I use names for my form elements that are not Model/field I get a fatal error on rendering. Is this is by design? It just seems inflexible - which I know may be a trade off for all the speedy baking convention allows us. Is there anyway we can flag elements as "model=null" to the HTML helper? -ad --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How can I add admin directory under cakephp framework?
Hi, I'm rewrite my old applications using cakephp, but find a problem at the very beginning. My old application has 2 parts. One for normal visitor and one for administation staff. http://my_system/ -> for normal visitor http://my_system/admin -> for admin staff. It is quite straightforward in my old layout. Just create a dir named "admin" under web server root. But it seems difficult to implement such simple task under cakephp framework. I created a subdirectory under "controllers" dir and add following line to routes.php $Route->connect('/admin/*', array('controller' => 'admin/dashboard', 'action' => 'display')); Of course, it doesn't work. Cakephp is confused about the directory and class name. I tried the RoR application "Typo 4". It has similar structure. It has a subdirectory "admin" under controllers directory and it works fine there. I don't know much about ruby on rails so I cannot figure out how to do it. How can i setup the correct routes in cakephp to add a simple backend admin directory? Thank you, Ji Tao --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
has many through associations
i wonder if it's possible to implement a has many through associations in cakephp, just like in rails. ex.: Forum hasMany Topics Topic hasMany Posts Forum hasMany Posts through Topics can anyone think of a way to do this in cake? 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 -~--~~~~--~~--~--~---
Help with HABTM!
Please can anybody help! I can retrieve or save to my models. Two tables users and roles and join table roles_users Thes are my models class User extends AppModel { var $name = 'User'; var $recursive = '2'; var $validate = array( 'username' => VALID_EMAIL, 'password' => VALID_NOT_EMPTY,'first_name' => VALID_NOT_EMPTY, 'last_name' => VALID_NOT_EMPTY); var $hasAndBelongToMany = array('Role' => array('classname' => 'Role', 'jointable'=> 'roles_users', 'foreignKey' => 'user_id', 'associationForeignKey' => 'role_id', 'condition'=>'', 'order' => 'Role.name ASC', 'limit'=> '', 'uniq' => 'True', 'finderSql' => '', 'deleteQuery' => '') ); class Role extends AppModel { var $name = 'Role'; var $validate = array( 'name' => VALID_NOT_EMPTY, 'description' => VALID_NOT_EMPTY); var $hasAndBelongToMany = array('User' => array('classname' => 'User', 'jointable'=> 'roles_users', 'foreignKey' => 'role_id', 'associationForeignKey' => 'user_id', 'condition'=>'', 'order' => '', 'limit'=> '', 'uniq' => '', 'finderSql' => '', 'deleteQuery' => '') ); I know i should use ACL for this but just trying out to get good grasp of the association. when i save a new user i want a record added to the join table based on a default role. what am i doing 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 -~--~~~~--~~--~--~---
Re: Models, find/findAll and object programming
hmm the data arrays are just "formats" to exchange information between controllers, functions etc. you could refactor this to be object-style, but imo this doesnt have much to do with OOprogramming. cause the "real" objects in OOP are fixed entities (like the models that we use in cake), in real OOP you also pass data as being arrays, because you need some sort of container that contains "chunks of concentraded information" , not only the content, but also the structure of these are very variable, and can't really be written down in a class, which is the mother of objects. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: open_basedir restriction in effect Help Needed
Sebastian Macias <[EMAIL PROTECTED]> wrote: > Warning: main() [function.main]: open_basedir restriction in effect. > File(/cake/bootstrap.php) is not within the allowed path(s): For whatever reason, it sounds like cake can't figure out its starting directory in order to locate the cake sibling of app. You could try setting the define()s in app/webroot/index.php to be the actual path string instead of the functions on __FILE__. Hope that helps, -- MJ Ray <[EMAIL PROTECTED]> www.ttllp.co.uk +44-870-4321-9-10 Web, localisation, koha, databases, GNU/Linux and statistics. Registered in England and Wales, partnership number OC303457 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: 1:many association where order is important
what kind of key-value pairs? and how to save all that? afaik i need to save 1 record (model) at a time (in a loop) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: 1:many association where order is important
you could try forcing the data since you have had to mess with the form elements. you can just assign key value pairs to the data array before you save it. That might do it. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
open_basedir restriction in effect Help Needed
Hi bakers, I have been looking for a solution of my problems for two days. So just gave up and decided to ask for help here. I have a cakeapp that works perfectly in my local machine, but in the production server is giving me the following warning and error: " Warning: main() [function.main]: open_basedir restriction in effect. File(/cake/bootstrap.php) is not within the allowed path(s): (/var/www/vhosts/begreennow.com/httpdocs:/tmp) in /var/www/vhosts/begreennow.com/httpdocs/webapp/app/webroot/index.php on line 81 Warning: main(cake/bootstrap.php) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/begreennow.com/httpdocs/webapp/app/webroot/index.php on line 81 Warning: main() [function.main]: open_basedir restriction in effect. File(/cake/bootstrap.php) is not within the allowed path(s): (/var/www/vhosts/begreennow.com/httpdocs:/tmp) in /var/www/vhosts/begreennow.com/httpdocs/webapp/app/webroot/index.php on line 81 Warning: main(cake/bootstrap.php) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/begreennow.com/httpdocs/webapp/app/webroot/index.php on line 81 Fatal error: main() [function.require]: Failed opening required 'cake/bootstrap.php' (include_path='.::/var/www/vhosts/begreennow.com/httpdocs/webapp:/var/www/vhosts/begreennow.com/httpdocs/webapp/app/') in /var/www/vhosts/begreennow.com/httpdocs/webapp/app/webroot/index.php on line 81" I have shell access to the server and can do whatever you bakers tell me to do in order to solve the problem. PHP Safe Mode is turned off. Thanks, Sebastian Macias --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: 1:many association where order is important
okay i've put the [$i] before the model, so that i can loop and save the songs like they should http://cakephp.org/pastes/show/0693a60ff666745694d660c8c794ab20 but still i have problems with the top5 itself. since it has no fields (except the id), i thought i could just do $this->Top5->create(); $this->Top5->save(); but that does not result in an insert query? :s $this->Top5->save(array('Top5'=>array('id'=>'')); works though, i could do an getLastInsertId() on that, but even then i have to write a loop that alters all the songs to "contain" the right top5_id, this is do-able, but i think it could be easier then 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 -~--~~~~--~~--~--~---
Re: Advice welcome: Session, HABTM
bwaters wrote: > Not sure what the "right answer" on your session setup is but I'll tell > you what I have done. > I built an authentication object that holds the user and current > session info as a component. > > I add a variable to appmodel to hold a reference to this component in > this case > > var $asAuth = false; > > Then in the startup for the authentication component i put this code > (also could put similar code in app_controller) > To add a reference to the object in all of the models the controller > uses. > > if (isset($controller->uses) && !empty($controller->uses)){ > for($i=0;$iuses);$i++){ > $controller->{$controller->uses[$i]}->asAuth = &$this; > } > } > > This works unless you create the model directly (like from another > model). Also, I always use uses even if it is the natural model for > the controller Well, thank you for your contribution. I'll try this, since I'm not yet familiar with components, it will be a good exercise. Thank you very much. For my N.2 problem, I abandoned the HABTM clauses and fell back to good old hasMany and belongsTo, with a Model for the join Table. As for now, the HABTM functionality is too limited for my needs, it seems... The only remaining problem is a side effect of this fallback: the join table must have a single primary key (such as 'id') Once again, a question of DB design, but I like association table to be association, and not entities. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: reading table from a component
Sorry, this is me being absolutely stupid. My problem, which is probably totally unrelated to Zoltan's, was that my User model was in a plugin (I thought it'd be easier to organise it that way). Hence whenever I wasn't in the plugin, my main application couldn't access the model for it. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Table Output Ordering
Thanks Eightyseven. That seems to be exactly what I was looking for. Nice to see the wiki updated. The last time I grabbed the pagination helper was back in November. Looks like it has been updated QUITE a bit since then. Trying to get back to see the new stuff. Like the event selectors I found to consolidate your AJAX calling and make the code more clean and much more degradable. 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 -~--~~~~--~~--~--~---
DEBUG=2, text/xml and AJAX
Hi list, I'm using cakePHP version 1.1.7. I'm delivering XML to the browser via XMLHttpRequest. The controller method looks like this: $this->RequestHandler->setAjax($this); header("Content-Type: text/xml"); $this->set('summary', $this->SiteSummary->summarize($this->data['Bookmark']['url'])); $this->render(); I have DEBUG set to 2. This appends a HTML table to the output which renders the XML invalid, and indeed responseXML is empty. I don't want to set DEBUG to 1 because the output is useful on normal pages. Does cakePHP provide for such a scenario? Thanks Markus --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: reading table from a component
Scratch that, my implementation was broken, and currently I don't know why. Perhaps someone more experienced can tell the both of us how exactly we can access Models in Components? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: From a MySQL datetime field into a $form->generateDateTime() field
ERRATA: Diz wrote: > Hello there! > >dateTimeOptiontag() is a real solution, but, still, it has it's own > problems. As you probably know 'datetime' in MySQL has a 'Y-m-d H:i:s' > pattern, and dateTimeOptiontag() returns only 'Y-m-d H:i' (if set on > 24-hour cycle) or 'Y-m-d H:i a' (if set on 12-hour cycle). >I would like that the development team to reconsider the use and > design of this function because working with datetime is necesary. > > Thanks, Diz! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: From a MySQL datetime field into a $form->generateDateTime() field
Hello there! generateDateTime() is a real solution, but, still, it has it's own problems. As you probably know 'datetime' in MySQL has a 'Y-m-d H:i:s' pattern, and generateDateTime() returns only 'Y-m-d H:i' (if set on 24-hour cycle) or 'Y-m-d H:i a' (if set on 12-hour cycle). I would like that the development team to reconsider the use and design of this function because working with datetime is necesary. Thanks, Diz! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Pulling data to the home page
I think AD7six was referring to your comment of wanting to use getUserList as an AJAX call. With AJAX, you would want to set your layout to something bare so you do not get the full page layout. RequestHandler would take care of some of this but not for this case AFAICT. In getUserList() call $this->layout = ''; or set it to 'ajax' or other bare layout. This way it works for ajax and for when you call it via requestAction. HTH, David --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Composit forms for composit models
afaik this isnt possible with the html helper. i also needed such a form , gave up on the html helper and just used the html code on itself. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: 1:many association where order is important
I got a little further, still no succes though i learned that i need to get rid of the html helper for 2 reasons: 1) the html helper always emits an "id" tag => if you have fields with the same name, you have twice the same id on one page. which is a violation of xml rules 2) i need to have an array in the form of [model][number][field]. in order to be able to loop through the array afterwards to save each unique record. with the html helper you can only get [model][field]. or [model][field][number]. but anyway, here is my new code: http://cakephp.org/pastes/show/967984a274afe9b3710428e5a6a2 i think i'm pretty close but still need some 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 -~--~~~~--~~--~--~---
Composit forms for composit models
I have a single form for adding a composit model that is laid out somthing like Vendor::Person::Address, Vendor::Outlet::Address and I need the html helper to genreate form inputs named: name="data[Person][Address][address1]" and name="data[Person][Address][address2]", etc. I've tried : input('Person/Address/address1', array('id' => 'person_address_address1', 'size' => '40', 'value' => $addresses['Address']['address1'], )) ?> and even input('Person/Address/address1', array('name' => 'data[Person][Address][address1]', 'id' => 'person_address_address1', 'size' => '40', 'value' => $addresses['Address']['address1'], )) ?> But I end up with inputs like: name="data[Person][Address]" for all the inputs in the address model that I'm trying to incorporate into the form. Please help. -Stuart --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: reading table from a component
You should be able to use $this->controller->ProductSection to get access to your model, it's what I've done in my Auth component and it seems to work ok. It's just that extra level of redirection there :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Pulling data to the home page
AD7six wrote: > You could just put > > echo $this->requestAction ("/users/getUserList",array("return"=>true)); > I'm sorry. I tried this method and got a full page loading into another full page. AD7six: I used the method as described in the manual: http://manual.cakephp.org/chapter/controllers function index() { $this->set('users', $this->requestAction('/users/getUserList')); } My userscontroller has the getUserList function, and my user model has the getUserList call that is a findAll(). Like I said, it works with the aforementioned way of using the model directly, but when I try to use the requestAction it doesn't work. The manual seems wrong or am I missing something? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Further Authorization Fun
Thanks :) Well, I'll take a look. I've previously used MPTT tables, part of my application is a photo gallery, and initially I was using MPTT as a way to organise albums into subfolders etc - but for the performance reasons I've decided against that (plus my code was hideously ugly and convoluted!). I've fixed my own authentication system now so it should in theory work - if db_acl doesn't work out, then I've already come up with some access control code which should do the job anyway. As a couple of other people have mentioned, I really wish Cake was able to return objects instead of arrays, it would make some of the things I'm doing here a little easier. But not to worry, this is still a much better framework than Symfony and Prado, which I used before :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Further Authorization Fun
Hi MrTufty, If you don't need conceptual explenations (which it sounds to me like you don't) I would suggest: installing the acm plugin there are instructions on use in the index page (if you just drop it in it wont, look for index.thtml in the view files) correct the initial problems you might have (e.g. it needs the config file in the download to be included somewhere) Load your users, create some acos using the gui Put a call like this : "if ($this->Acl->check($aro, $acoAlias, $action='*')) {" in an appropriate place. Add some logging so you can see the results of these calls on the screen/in the log. And in principle by the time you get to there (it might take you an hour) you should be quite au fait with how cake has put in place db acl. Be aware that if you delete a node which has a parent it corrupts things a bit (there are google threads on how to deal with this) and adding to MPTT tables can be quite slow, reads are as fast as they come though ;) I'll leave it at that for now, Cheers, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Should I relate the ACL tables to other tables in my DB?
Hi, I have read the ALC-tutorial, which is great! However I still have some questions. Background/scario I'm making a role based portal that is shared by many organizations and many users who belong to these organizations. The individual users "view" and what they can do, is determined by their association with different roles and organizations. If a person is a member of a specific organization, she can create content for this organization and see stuff that other members of that organization has published. She might not be able to see or create content that has been created by users who belong to other organizations (that she is not a member of). For my project I need to control access to individual comments, news, files, articles etc. ACL should be ideal for this. The different kinds of content are organized in different tables (news, files, articles etc.). This means that I can't just put a "content id" in the AROs object_id, because a news_id, a file_id might be the same (I will not be able to distinguish them from each other). I guess I could combine the id with an alias, so that the ARO for example will have an alias="comment" and object_id=2 or alias="article" and object_id=2. I could also associate the aros tables with every table that holds content, so that the articles, files, comments, and news get an aros_id. But I guess that the aros table need an object_id or alias for the ACL-checking to work. What is the best way? I hope this makes sense ;-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Pulling data to the home page
Hi dmancan, dmancan wrote: > function index() > { > $this->set('users', > $this->requestAction('/users/getUserList')); > } Why do this? You could just put echo $this->requestAction ("/users/getUserList",array("return"=>true)); In your view to get back the content of calling the url "/users/getUserList" in the relavent place. If you want to get the list of users in your controller method, ensure that you have coded this method 'getUserList' in controller 'users' to return a value ;). HTH, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Table Output Ordering
Hi Troy, Try this> http://wiki.cakephp.org/tutorials:pagination It seems to me it does exactly what you are asking ;) (My site is currently offline, so no live examples at the time of posting). Cheers, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Pulling data to the home page
I tried using the requestaction method, but could only get back empty sets. If I do this...I get my dataset: var $uses = array('user'); function index() { $mdlUser = new User(); $this->set('data', $mdlUser->getUserList()); } If I do this, I get an empty dataset: function index() { $this->set('users', $this->requestAction('/users/getUserList')); } I'd prefer to use the request action for ajax reasons. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Models, find/findAll and object programming
Thanks all ;) I know of limitations of OO in PHP4. I "prefer" version 5 ... if I'm able to choose not to use it :D Bret writes : "to override the core of cakePHP's behavior and write code that takes cake's array format and converts it to objects" That's what I have done (adding some findOO method, calling find and returning an instance). And it's not really hard to code. That's why I'm so surprise it's not in the cake package yet. But from now, I will wait for the 2.0 version, hoping those functionnalities will be considered as important. And for the time, I will try to find some real OO solution online, like Rails. Tony --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
FW : NEW 48 JOBS POSTED THIS WEEK ARE AS FOLLOWS:
Hi Dear Members, FOLLOWING R THE NEW JOBS POSTED THIS WEEK (WEEKLY NEWSLETTER) : Job Title Job Posted By Java,J2ee,Weblogic,Oracle. abcde Urgent Requirement-Datawarehousing imaatrixx SAP SOX CONSULTANT DISTRIBUTED SOFTWARE SOLUTIONS Urgent Opening : Project Lead (Java/Oracle) CORBUS (India) Pvt. Ltd Sr.Recruter Vanceva Tech Pvt. Ltd Wanted S/w Dvlpr with 0-2 yrs exp in ASP,J2EE & VB DCS BPO PVT LTD. Sr.Peoplesoft Consultants Acculogix Software Solutions Operations Manager | 6+Yrs | MNC-Courier Industry Endurance Consulting Urgent Job Opening -Project Leader(Oracle- PL/SQL) CORBUS (India) Pvt. Ltd Urgent Job Opening -Sr. Software Engineer (Oracle) CORBUS (India) Pvt. Ltd Java Developer GD Consulting Wireless Application Developer in .Net GD Consulting call centre agents pecon IT Professionals - Dubai Gulf International Group CALL CENTER PROFESSIONALS - Top Dollars paid Gulf International Group WEB DESIGNERS / WEB DEVELOPERS - DUBAI Gulf International Group FRESH GRADUATES - DUBAI Gulf International Group ACCOUNTANTS - DUBAI Gulf International Group Dotnet Vista Infotech PHP Linux Based Web Developers AMAB Proff. Engineers Geomech Oil programmer Aditya Technologies Enterprise Sales Manager Charterhouse Partnership Senior Finance Manager Charterhouse Partnership Support Engineer - Sales Charterhouse Partnership Software Engineer Outworks Solutions Ltd PHP Programmer Immediately required with 2+yrs exp Olive Technology LTD "Oracle Apps DBA" SQL Star IT Recruiter keriosolutions.inc Req-0304 -Microsoft / Citrix System Engineer keriosolutions.inc Req-0285 - SQL / Oracle DBA keriosolutions.inc J2EE sagittus Solutions Pvt Ltd Business Development Manager Emergys Software Pvt Ltd Opportunity for .Net with_ GCI,Microsoft YS Consulting Microsoft SQL Database Administrator for UAE Vinirma Consulting Pvt. Ltd. Urgently Required Credit card Professional For UAE Vinirma Consulting Pvt. Ltd. Urgently Required Delphi Programmer For Qatar Vinirma Consulting Pvt. Ltd. JAVA JLPT Infitech Global Urgently Required Tandem CobolProfessional For UAE Vinirma Consulting Pvt. Ltd. Required Oracle Application Database Administrator Vinirma Consulting Pvt. Ltd. Req Graphic Designer Anand Rathi Electrical Engineer Iron Ring Staffing Solutions I Electrical Designer Iron Ring Staffing Solutions I Instrumentation and Control Engineer Iron Ring Staffing Solutions I Planner and scheduler Iron Ring Staffing Solutions I Junior Municipal Engineer/Technologist Iron Ring Staffing Solutions I Need Microsoft SQL Database Administrator For UAE VAM SYSTEMS FZC Need Credit card Professional For UAE VAM SYSTEMS FZC Mortgage Originator National Lending Corporation PLS APPLY ONLINE ON www.net4professionals.com *Looking For Better Jobs/Employee? -Search Jobs/Resumes and Apply Online/Call 4 Interview FREE -Browse Interveiw Calls Free -Employers Can Post 5 Jobs Free And Also Win Free Gifts http://www.net4professionals.com (A2Z HR INFO SERVICES INDIA)THE COMPLETE e-JOBS SOLUTIONS PROVIDER... 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 -~--~~~~--~~--~--~---