I'm developing a basic application with Cakephp. It´s a FAQs page with login for an administrator that can edit the FAQs. The problem is that I want to show the FAQs in the main page as well as a form that allows admins to login. I've seen examples but I don't know how to follow correctly the MVC. How should the Faq, User and (possibly) ...
I'm using CakePHP and I have a component I wrote that uses a component called "Users" to handle users login, logout, registration, etc. I would like to render that on the default.ctp layout in a sidebar. How can I do this?
I tried:
<div id="leftNav">
<div id="login-block" class="block">
<?php echo $this->element...
I want to extended, not just create a new instance of a class I have sitting in my vendors directory. I googled and read the docs but I see no support for it.
Can I do an app import of the 3rd party class, then write up the extended class followed by a component that will use my child class?
i.e
/* vendors/yahooapi/yahoo.class.php */...
The problem is i want to call the index function, i need it to render the view and then the
afterFilter to redirect again to the index function and do the same.. Like a loop, the problem is it doesnt render it, ive tried using $this->render('index') but it doesnt work and also other things..
PS: I didnt include all the code that i have ...
hi,
this is my problem
i,ve to create a dropdown list box from a table states('id','state_name') which is not my default model( which has many fields one of the field is 'state' in which i store states('id') .
so i used loadModel to populate the drop down box.
in my controller i used
$this->loadModel('State');
$this->set('states',$this-...
I'm using cakephp and I want the login view for the controller 'users' to be displayed on the default.ctp for the layout controller. I can I do this?
For example:
<div id="leftNav">
<div id="login-block" class="block">
<?php
//render users/login here
?>
<ul>
<li><a href="/users/login...
I'd like to be able to get some websites currently hosted in linux moved across to Windows-based hosting where we already have a reasonable number of sites hosted (not looking to switch to Apache since majority of sites are relying upon IIS), and have tried a few different mod_rewrite variants for IIS but not had any success getting any ...
I have the following app_controller in app/controller.
the test function is never executed. If I put in the subclassed controller, its not executed there either. am I doing something wrong?
class AppController extends Controller {
var $beforeFilter = array('test');
function test() {
var_dump('test');
die();
}
}
...
Is anybody else using David Persson's media plugin for CakePHP? I'm struggling with setting up some features of the latest version. I'd like to set it up to make a UUID-based filename for uploaded images, but I'm not sure how to go about it.
I will fight with it some more, but I'm posting to find out if anybody here can tell me if the 1...
Hello
I have two models, Post hasMany Comment. How do I select all Post that have less than two Comment?
I tried using a find with 'fields'=>array('COUNT(Comment.id) as numComments','Post.*'), (and then doing a numComments < 2 in 'conditions'). But, I get a Unknown column 'Comment.id' in 'field list' error.
Thanks!
EDIT: I've gotten ...
hi all,
i want to develop search system in my cakephp application, by adding extra functionality in controller, and it works fine.
as you probably guess, after search and viewing record, when i return to index (list) page, i have all results from proper model, and search result is "forgotten".
so i guess that i have to keep my sql que...
Hi,
When I search a model which "has many" of something else.
For example a blog post has many categories.
When searching for blog post with categories associated, how do I order the associated categories? When the array is returned it ignores the order on the category model and defaults to it's usual id order.
Cheers.
...
I'm at the point where I need to write unit tests for a REST API written using CakePHP 1.3. The API supports GET, POST and PUT requests for querying and manipulating data.
Is there any established way to test the correct input/output of an API simulating an HTTP request, using fixtures? I do not want to run actual POST/PUT requests agai...
I have plugin
plugin: tree
-----controller: tree
-------------action : admin_index
DB Table aros_acos has updated _CRUD 1 1 1 1 for this aco.
I code $this->Acl->check(array('model'=>'User','foreign_key'=>2),'Tree/Tree/admin_index');
error:
DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:
Aro...
Is there any way of fetching only those records of a model which have 'status = 1' in cakephp v1.3 ?
I have created a field named 'status' in every table of my web application.
I have a model named 'Message'. What I want is that only those messages are displayed, included in search results which have 'status = 1'. Messages with a 'stat...
Hi,
I'm trying to handle bounced message and send to a responsible System Administrator.
I use CakePHP Email Component to send the message. On server side, I use postfix to transport the message.
function sendAsEmail($data) {
$Email->sendAs = 'html';
$Email->from = $user['Sender']['username'] . '@example.com';
$Email->return = ...
Hi
I have built an cakephp site that lets users upload files, all works fine but I would like to show a image saying "file uploading" or something while it is uploading. Now I know that I should use the $ajax->form helpers but I can not seem to get this to work. Can some one point me in the right direction please
form(array('type' => '...
I have a simple table with 3 values principle, interest, period. I want to show these 3 values
in a table along with calculated simple interest. This interest is for display only, wont be stored in the DB. How can i achieve this ? I know I can use Javascript to compute the interest and render it, but can I do it via Cakephp?
...
I recently started using CakePHP and am trying to define User-specific "field" preferences. Basically, I want each user to be able to specify which fields he/she wants to see in a table.
To do this, I have a users table, a fields table, and a fields_users table. The last table is just a field_id and user_id, so the code knows to lin...
<div class="nhplft">
<div class="view_item_title"><i><?= $users["First_name"]["First_name"]; ?> in MANHATTAN has (an)</i> <?= $item["Item"]["item"]; ?><br /></div>
that line of code is pulling the item name from the ITEMS table and the ITEM field... what can i do to display the user first_name from USERS table in the same database o...