Re: Using $this-set in view doesn't set the var
Yip, the api does state Allows a template or element to set a variable that will be available in a layout or other element, but maybe this is when the element is being called from the view not the layout? People are not really supposed to read your layout though, that is set and should rarely be changed. Plus it's a lot cleaner to only be echoing $content_for_layout, $menu_for_layout etc. than it is to be calling all view data from the layout. However, I am not experienced enough with MVC to give a compelling argument against it, I just know when something rubs against Cake's conventions then it;s normally not a good idea. HTH, Paul. On Sep 9, 9:18 pm, Xoubaman xouba...@gmail.com wrote: http://api13.cakephp.org/class/view#method-Viewsethttp://book.cakephp.org/view/1086/set Someone of the core team answered that Var::set could be used to solve a similar issue in a post I here found when searching to my question. Don't remember the search subject now :( I mean cleaner in the sense of it's more readable one layout with some echo $var that another one with some echo $this-element(name, params stuff), almost in the application I'm developing. Maybe it's not the most elegant way, but, if we should not set vars in the views, why is still a method to do it? -- 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
async post cause controller error in 2.0
Hi all, I'm facing a strangeness in cake 2.0 Using a filter form, which work well on normal post, if (with jquery) I bind the form.submit() with something like /$.post( form.attr('action'), form.serialize(), function(data){ $(#restable).html( $(#restable, data).html() ) } );/ which should post the form data and render the returned html substituting the #restable inner html. (This was working with 1.3) in 2.0 I get: Missing Controller *Error: * /Controller/ could not be found. *Error: * Create the class /Controller/ below in file: app/Controller/Controller.php ?php class Controller extends AppController { } Any suggestion? Thanks in advance, Luca -- 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
Re: joining strings in model
Apologies in advance if this sounds stupid, but have you tried setting this property in the constructor or it's cake equivalent? On Sep 9, 4:28 pm, lyba l...@poczta.fm wrote: Any suggestions why it is not possible to join strings in a model file: $foo = 'A'.'B'; this produces error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in .\app\models\event.php on line 7 A real life scenario: I have a model Event that has a self reference and is called under different aliases (Event, PreviousEvent, NextEvent). I need a virtual name for that model as an extract from the event description this works: public $virtualFields = array('name' = 'LEFT(description, 40)'); but since model is called under different aliases in one request I get warning: Column 'description' in field list is ambiguous I thought this would work: public $virtualFields = array('name' = 'LEFT('. $this-name .'.description, 40)'); but then I discovered that joining strings in model does not work at all. -- 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
Re: ckaephp 2.0 using Configure::read in model construct method
Thanks for you help but I am not sure that that is correct. Whilst I by no means pretend to be an expert at the inner workings of cakephp, the construct function in UserModel is called as the user model is first constructed, The parent::__construct() function in Model actually initializes the behaviours so my theory was that if I change the value of actsAs prior to parent::__construct() then I should be able to change the settings of the behavior. Also if I simply echo the value of configure::read(..) then the correct value is printed to the screen showing that the configure values have actually been set when the UserModel __construct() function is called. This at least makes sense to me, whether I am right or not is a completely different matter. -- 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
Re: ClassRegistry::init and Model function availability problem
Bumps. Can anybody help me out with this? -- 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
fopen(.../app/tmp/cache/persistent/cake_core_default_en-us) [function.fopen]: failed to open stream: No such file or directory
Ok, I have two separate Cake applications, both experiencing this error. And in the one case, its a brand-new installation. I quite literally just uploaded the files and setup permissions on the tmp directory. I'm running an Ubuntu Linux server. The other installation has been running without incident until last weekend and I'm just getting back to this now. My first instinct is to think this is a permissions problem. However, looking at the permissions on the tmp directory and its subdirectories, they're all set to 777. That being the case, I don't think ownership should be a problem, should it? -- 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
Re: joining strings in model
You can use beforeFind Model's callback otherwise Model constructor. I prefer beforeFind method. class AppModel extends Model { [...] public function __construct($id = false, $table = null, $ds = null) { // Set here virtualFields ($this-virtualFields = X) $this-virtualFields = array( 'name' = 'LEFT('. $this-name .'_'.description, 40)' ); parent::__construct($id, $table, $ds); } public function beforeFind($queryData) { // Set here virtualFields ($this-virtualFields = X) } } On 10 Set, 11:02, the plumpNation plumpnat...@gmail.com wrote: Apologies in advance if this sounds stupid, but have you tried setting this property in the constructor or it's cake equivalent? On Sep 9, 4:28 pm, lyba l...@poczta.fm wrote: Any suggestions why it is not possible to join strings in a model file: $foo = 'A'.'B'; this produces error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in .\app\models\event.php on line 7 A real life scenario: I have a model Event that has a self reference and is called under different aliases (Event, PreviousEvent, NextEvent). I need a virtual name for that model as an extract from the event description this works: public $virtualFields = array('name' = 'LEFT(description, 40)'); but since model is called under different aliases in one request I get warning: Column 'description' in field list is ambiguous I thought this would work: public $virtualFields = array('name' = 'LEFT('. $this-name .'.description, 40)'); but then I discovered that joining strings in model does not work at all. -- 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
Re: How safe is CakePhps auth component and other ..
Thank you very much, you are most kind ! All the best, Milos On Sep 9, 4:54 pm, Thomas Ploch profipl...@googlemail.com wrote: 1.) The Auth component is safe. It uses a salted SHA1 encrypted pw by default. It auto-escapes the fields already, so you don't have to bother with it. Just use SSL to encrypt the connection to sensitive parts of the application to be on the (very) safe side. 2.) Well, if you use the Apache web server, and you configured it correctly to write the access.log file, you got everything you need there. (Other web servers have this feature too) Kind regards Thomas Am 09.09.2011 16:44, schrieb Miloš Vučinić: Hi, I have two questions and I hope someone can help me.. I am making application which needs to be relatively safe. So here are questions I have for you: 1. I am using auth component from cakephp , but I cannot escape the login fields because login component works for itself and I cannot edit it's code.. I am wondering is it sql injection safe and are there any possible problems with it regarding security ? 2. I need to log every http request made to my website (so that if someone tries to hack the web site that I have info about his IP address and what exactly they tried to do). I need exact link which was typed and ip address of a computer which made the request. A whole http request would be nice but at least these two. Is there any way to do this (like a pre build component), or where in my source code should I place the code for this .. ? Thank you , all the best Milos -- 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
Problem importing Comments Behavior Class in Controller class
I was installing the Comments Component from CakeDC ( https://github.com/CakeDC/comments ) But I have a strange error with Cakephp 1.3, my Controller refuses to import my Model Behavior, i dont know if its an error of Inflector Name to access the correct Behavior Class name but look at this = in my controller i have: public $components = array('RequestHandler','Comments.Comments' = array('userModelClass' = 'User')); and the cake classes transform into app\models\behaviors\comments.commentable.php and the expected name of the behavior: class Comments.CommentableBehavior as you can see it adds a dot point before my Behavior Name. Any recommendations, or ideas are welcome. -- 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
ACL - Access Control List - Lista de Controle de Acesso
Galera, sei que o espaço aqui é em inglês, mas sei que tem uma galera brasileira, que posta aqui. Alguém aqui trabalha com ACL? Estou seguindo o exemplo abaixo: http://book.cakephp.org/pt/view/1543/Sistema-Simples-com-controle-ACL-Lista-de-controle Gostaria de implementar maior restrição à edição de posts, podendo ser editado somente por quem criou, ou algum gerente. Estou tentando usar o método afterSave() para adicionar permissão no modelo Post: line 33: $this-Acl-allow(array('model' = 'User', 'foreign_key' = $this-data['Post']['user_id']), $node[0]['Aco']['id']); Está exibindo este erro: Undefined property: Post::$Acl [APP\models\post.php, line 33] Algum dica? -- 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
Re: Blog Tut help
Just use the Helper Html in your Controller. public $helpers = array('Html','Javascript'); On Sep 9, 9:17 am, Jeremy Williams cop...@gmail.com wrote: I did the blog tut on: http://book.cakephp.org/view/1528/Blog; and i have an error: Notice (8): Undefined property: View::$Html [APP\views \posts\index.ctp, line 4] basically i am too new to cakephp to understand what this means or how to fix it. Here is some other information it gives me, hope it can help you help me. h1Blog posts/h1 p?php echo $this-Html-link(Add Post, array('action' = 'add')); ?/p include - APP\views\posts\index.ctp, line 4 View::_render() - CORE\cake\libs\view\view.php, line 718 View::render() - CORE\cake\libs\view\view.php, line 417 Controller::render() - CORE\cake\libs\controller\controller.php, line 861 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 243 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 206 require - APP\webroot\index.php, line 83 [main] - CORE\index.php, line 55 -- 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
Email component working wrong
Hello, I have a function sending email to all the users, and every email sent is copied to another email address too: [CODE HERE] $this-Email-to = $User['User']['username']; $this-Email-bcc = array('b...@hotmail.co.uk'); [CODE HERE] The thing is the email sent to the user is different than the copy. I have no idea why it happens, the commands are one under another as shown. Please help, Peter. -- 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
Re: Unable to install CakePHP
this all are a problem of mac os this is already running in the win7 and all old os On Sat, Sep 10, 2011 at 2:01 AM, Yves S. Garret yoursurrogate...@gmail.comwrote: Ok, now it works. XAMPP did it. On Fri, Sep 9, 2011 at 1:52 PM, Chris theswimmingf...@gmail.com wrote: Why don't you just uninstall those things and run something like WAMP which is auto setup or the like? XAMPP is another good one which I think is a little easier than WAMP, I'm not sure since I haven't used it, and I also THINK it's updated more regularly http://www.wampserver.com/en/ http://www.apachefriends.org/en/xampp.html This should solve your issues and afterwards its just a simple copy and paste in to the Apache folders. On Sep 9, 1:20 pm, Teddy Zeenny teddyzee...@gmail.com wrote: Doeshttp://localhost/give the same page ashttp://localhost/index.php? On Fri, Sep 9, 2011 at 6:56 PM, Yves S. Garret yoursurrogate...@gmail.comwrote: Changed all overrides to All (some places where I've read it's a no-no to do), still nothing. On Fri, Sep 9, 2011 at 11:48 AM, Sam Sherlock sam.sherl...@gmail.com wrote: I see an AllowOveride None change this to AllowOverride All restart apache :) - S On 9 September 2011 16:25, Yves S. Garret yoursurrogate...@gmail.comwrote: I tried the following without success: IfModule dir_module DirectoryIndex index.php /IfModule IfModule dir_module DirectoryIndex index.html index.php /IfModule The PHP page still worked, but I couldn't get the CakePHP page up. On Fri, Sep 9, 2011 at 10:43 AM, Sam Sherlock sam.sherl...@gmail.comwrote: I think your issue is that directory index should be php (your config was set to html) IfModule dir_module DirectoryIndex index.php /IfModule - S On 9 September 2011 14:01, Yves S. Garret yoursurrogate...@gmail.comwrote: Is it possible to make attachments in this mailing list or should I upload the files somewhere and then throw a link? On Thu, Sep 8, 2011 at 7:31 PM, Sam Sherlock sam.sherl...@gmail.comwrote: Your server is not configured correct. Is php set? Can you display php info? Is mod rewrite setup? - S On 8 Sep 2011 22:36, Yves S. Garret yoursurrogate...@gmail.com wrote: I'm using Google Chrome, would that be an issue? I doubt it... On Thu, Sep 8, 2011 at 4:34 PM, Teddy Zeenny teddyzee...@gmail.com wrote: Yes, simply go to:http://localhost/cake_1_3/ You should see the default CakePHP page which will tell you what is working and what's not... On Thu, Sep 8, 2011 at 9:53 PM, Yves S. Garret yoursurrogate...@gmail.com wrote: Hello, I tried posting this before, but did not see it show up in the mailing list, so I'll try again (maybe I messed something up in the process?) I managed to get MySQL, Apache and PHP 5 installed on my Windows 7 machine. I'm a little lost as to how to install CakePHP. I did what was described in here: http://book.cakephp.org/view/913/Development But how can I get a It works! (or something similar) message from Apache indicating that it works? I have the DocumentRoot at: C:\server \www\myserver.dev\public_html and in that directory I have cake_1_3, I can do localhost/index.php (there's a PHP file in public_html to test that Apache works with PHP and it does), but is there something similar for CakePHP? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group,
Re: 'Site under maintenance' option
can u explain me that what is B plan On Sat, Sep 10, 2011 at 1:51 AM, Xoubaman xouba...@gmail.com wrote: Ip ranges is my B plan, but could be a problem with non-tech skilled admin users login from dinamic ips. I will come to this point later, so thanks for the answers, hope I can find a good solution. -- 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 -- 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
Re: Blog Tut help
there are some defaultness just in place of var we can use varchar On Fri, Sep 9, 2011 at 9:09 PM, Sam Sherlock sam.sherl...@gmail.com wrote: I added the code from prev post to your code below. as you add more controllers you'd be better off adding general comps helpers to the app_controller - S On 9 September 2011 16:21, Jeremy Williams cop...@gmail.com wrote: this is my controller. ?php class PostsController extends AppController { var $name = 'Posts'; var $helpers = array( 'Form', 'Html', 'Session' ); var $components = array('Session'); function index() { $this-set('posts', $this-Post-find('all')); } function view($id) { $this-Post-id = $id; $this-set('post', $this-Post-read()); } function add() { if (!(empty($this-data))) { if ($this-Post-save($this-data)) { $this-Session-setFlash('Your post has been saved.'); $this-redirect(array('action' = 'index')); } } } function delete($id) { if ($this-Post-delete($id)) { $this-Session-setFlash('The post with id: ' . $id . ' has been deleted.'); $this-redirect(array('action' = 'index')); } } function edit($id = null) { $this-Post-id = $id; if (empty($this-data)) { $this-data = $this-Post-read(); } else { if ($this-Post-save($this-data)) { $this-Session-setFlash('Your post has been updated.'); $this-redirect(array('action' = 'index')); } } } } ? -- 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 -- 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 -- 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
Why is this better?
I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- 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
CakePHP email component problem
Hello, in my application there is a part of a code responsible of sending an emails to my users. It is a loop cycling through the whole database of users and just sending the email. Also when any email is sent, there is a copy sent to another email addres. The problem is that some of the users recieve other content in their email than it is in the copy. The commands are one under another, so I have no idea why this is happening: if ($TestMode == 'live') { // if not in test mode $this-Email-to = $User['User']['username']; // username - user's email address $this-Email-bcc = array(c...@here.co.uk'); // mail to send a bcc copy }else{ // if in test mode $this-Email-to = array('sysadm...@hotmail.co.uk', 'sysadm...@gmail.com', 'sysadm...@googlemail.com'); } // Send e-mail to user. $this-Email-subject = 'blahblah; $this-Email-template = 'my_template'; $this-Email-sendAs = 'html'; $this-Email-send(); $this-Email-reset(); The above code is a part of the loop. But the question is, why some users are getting another email than it is sent to c...@here.hotmail.co.uk ? Maybe this problem is of another matter? Please help! -- 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
Re: How safe is CakePhps auth component and other ..
Hi Milos, SSL is a must... take care of what happen recently to me: http://cakephp.19694.n2.nabble.com/Auth-ACL-proxy-server-mixed-up-sessions-td6535034.html Regards, Olaf. On 09/10/2011 02:36 PM, Miloš Vučinić wrote: Thank you very much, you are most kind ! All the best, Milos On Sep 9, 4:54 pm, Thomas Plochprofipl...@googlemail.com wrote: 1.) The Auth component is safe. It uses a salted SHA1 encrypted pw by default. It auto-escapes the fields already, so you don't have to bother with it. Just use SSL to encrypt the connection to sensitive parts of the application to be on the (very) safe side. 2.) Well, if you use the Apache web server, and you configured it correctly to write the access.log file, you got everything you need there. (Other web servers have this feature too) Kind regards Thomas Am 09.09.2011 16:44, schrieb Miloš Vučinić: Hi, I have two questions and I hope someone can help me.. I am making application which needs to be relatively safe. So here are questions I have for you: 1. I am using auth component from cakephp , but I cannot escape the login fields because login component works for itself and I cannot edit it's code.. I am wondering is it sql injection safe and are there any possible problems with it regarding security ? 2. I need to log every http request made to my website (so that if someone tries to hack the web site that I have info about his IP address and what exactly they tried to do). I need exact link which was typed and ip address of a computer which made the request. A whole http request would be nice but at least these two. Is there any way to do this (like a pre build component), or where in my source code should I place the code for this .. ? Thank you , all the best Milos -- - You don't know where your shadow will fall, Somebody.- - Ing. Olaf Reitmaier Veraciertaola...@gmail.com - Personal Web Page -- http://olafrv.com -- i...@olafrv.com - -- 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
ACL Tips
During this time I researched and analyzed the codes of the tutorials to fully understand the use of ACL + Auth with different permissions to groups, a topic with some complexity to my liking yet. I decided to put a couple of tips for those starting like me and have also some doubts, I hope they serve for the truth to me took quite able to understand and even I have some doubts about this. If possible if someone can pass answer the 3 questions that I put down I could use. If I'm wrong, feel free to correct me. $actAs=array('Acl'=' requester') * For models associated with the ACL tables * This requires the use of the function parentNode () in the model * This indicates that each time you create a record within the model that this work will create a record in the table rings. If two models were related, then take into account whether a record is created in either the creation of a ring. And in the 2 models should be associated with this variable by calling Acl function parentNode() * Used to be an association between parent model (hasMany) and child (belongsTo) * Used to assign permissions to users and groups. * Must return null, or the value node ACO / ARO * Also remember to use the $ this- data, which is receiving value function bindNode() * If you use to assign permissions to groups only * It uses the User model * You must be assigned as a variable parameter which is equivalent to $ this- data as it receives data. * The parameter assigned, you can call by: $param[$this-alias] o $param['name_model']['associated_field'] name_model, ej. ['User'] (remember uppercase ) associated_field, ex. ['group_id'], which has indicated in the Db node() *Gets the ACL node of the model used and returns *It you must set the id of the model, then you can use node () $this-alias *It is used in the model *Represents the model used *Do not use if you are representing another model *You can also use ['name_model'] parent::beforeFilter() *It is used in the controller *This indicates the relationship of father and son beforeFilter () in app_controller $this-Acl-check( $aro, $aco, $action = '*'); *The third parameter is optional and can be changed to permit default value is * *Return value boolean (TRUE/FALSE) $this-Auth-User() *Verify that the user has created a session *To collect user information Ex. $session-read('Auth.User.field'); field can be changed to show a specific field Yes. Field is not added, to compile all possible information field() *It is used in the controller *Used as a find, to get data from the database of a specific field For more information: http://book.cakephp.org/es/view/1245/Definiendo-Permisos-ACL-en-la-base-de-datos#!/es/view/1265/Atributos-de-AuthComponent http://book.cakephp.org/es/view/1249/Verificando-Permisos-El-Componente-ACL http://api13.cakephp.org/class/acl-base http://api13.cakephp.org/class/acl-behavior http://api13.cakephp.org/class/acl-node http://api13.cakephp.org/class/acl-component http://book.cakephp.org/view/647/An-Automated-tool-for-creating-ACOs Questions: *Differences between using parentNode () y bindNode () *Unlike content parentNode () parent-child model *Using the checkhelper () y AccessHelper -- 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
Re: Why is this better?
its a balance; the code you posted is readable and concise making links elements generally will add complexity to the simple and common (and varied task) of adding links when your link element has the ability to handle the various options it will be quite complex and the code will be less readable and also harder to adjust (the code to putput the link is going to be about the same). Plus it add no real advantage when you have a generic nature to a block of markup and vary parts within eg a piece of gallery content that contains a few divs and a h3 and a link with and image - S On 10 September 2011 13:12, elija elijatheg...@gmail.com wrote: I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- 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 -- 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