I have a controller called 'exposures' which I created automatically with the script/generate scaffold call. The scaffold pages work fine. I created a custom action called 'test' in the exposures controller. When I try to call the page (http://127.0.0.1:3000/exposures/test/1) I get a blank, white screen with no text at all in the sour...
Hi!
I´m trying to write a log system for my CakePHP intranet. What i need is to store de username/datetime whene someone tryes to login.
My login code is on the clients_controller and i need to store the data on a model called log (i have the model, controller, view... but they are not related)
how can i achive that?
thank you
...
Hi,
I am new to MVC, and trying something and got stuck somewhere in between.
I have a user control there I have three textbox html type(ID, Lastname, firstname) and a submit buttom.
I set the button like
<input type="button" value="Search"
onclick="location.href='<%= Url.Action("action", "controller") %>'" />
I ...
Can anyone tell me how to pass parameters to a function in another controller in cakephp?
...
i have Product and SalesOrder model (to simplify, 1 sales_order only for 1 product)
Product
has_many :sales_orders
SalesOrder
belongs_to :product
pa = Product A #2000
so1 = SalesOrder #1 order product A #1000, date:yesterday
so2 = SalesOrder #2 order product A #999, date:yesterday
so3 = SalesOrder #3 order product A #1000, date:now...
How could one do switch in ruby on rails something like:
case controller "home"
do home
case controller "about"
do about
else
do home
I currently have this code:
<% case current_page(:controller) %>
<% when "forums" %>
<%= render :partial => 'shared/sidebar/sidebar_forums' %>
<% when "events" %>
...
I downloaded the latest version of Zend framework, added a controller and I
can not get it to load.. Here is what I did:
C:\zend\Apache2\htdocs>zf create project myproject
Creating project at C:/zend/Apache2/htdocs/myproject
Note: This command created a web project, for more information setting up your V
HOST, please see docs/README
C:...
I wrote a shell method in CakePHP 1.3 that has a return value.
I'd like to be able to access that method from within a controller, so that I can pass its return value into the View.
I'm not sure how to access those methods appropriately from within the controller. Have I done it wrong?
I could easily duplicate the code, but I'd lik...
Another opinion question:
What is the proper (in your opinion) to check for nulls in an MVC controller. For instance, if you have an edit controller that fetches a record from the db based on an id, what do you do if that record is not found? I found this article, but I'm not sure I like that method. Do you just check for it with an ...
class MyController(BaseController):
def index(self):
# Return a rendered template
#return render('/test.mako')
# or, return a response
return ''
Why does the function "index" have "self"?
I got this code from Pylons controller
...
I know there are events for before/after a action is fired.
Is there anything higher up in the stack like before a controller is called?
...
I want media controls such as play/pause for streaming audio that I am playing in my app. I am using MediaPlayer to stream and play the audio.
Can someone provide a code snippet on how to use MediaController with MediaPlayer?
Thanks
Chris
...
What is the idea behind Grasp's Controller pattern?
My current interpretation is that sometimes you want to achieve something that needs to use a couple of classes but none of those classes could or has access to the information needed to do it, so you create a new class that does the job, having references to all the needed classes(thi...
Hi,
I have a controller called "Shops", this is the way the routing system looks for it, however I want to be able to called this controller and what not 'shop'.
Is it possible to do this.
Cheers!
...
I am adding MediaController to a VideoView, but it does not show up unless I tap the phone. The controller disappears after a while.
Is there a way I can have the MediaController show always?
Thanks
Chris
...
How to remove Navigation controller from stack?
When i push navigation controller it automatically get pushed into stack, after starting new navigational controller i want previous controller to get remove from stack.
thanks in advance.
...
At work, we have a situation where when
script/server
is run, then all the controller code is cached. This is to speed up the
development server. But that will mean that whenever we change the
controller code, we need to restart the server.
So we can turn off the caching of controller code all together. But
can't there be mechanis...
Hi guys,
I'm confused about exactly what I should have in my controller and what in my method.
Specifically, I have this in the action method:
public function upcomingshowsAction()
{
$gcal = $this->_validateCalendarConnection();
$uncleanedFeedArray = $this->_getCalendarFeed($gcal);
$finishedFeedArray = $thi...
I am trying to add ASP.NET MVC features(Especially Routing) to my already existing ASP.NET Web application.I added a Controlled and View (an asp.net page) .Now i want to know how can i display the details of object of my custom class( Ex : User) in the view ? Can assign the object in ViewData collection and render it in the view ? Hows ...
Is it possible that two different views use the same controller?
I have very complex controller that displays some data. Now I need to display this data (which is retrieved using ajax) in two partial views because I want to place them on different positions in layout.
...