w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
codeigniter not loading controllers
Add this to your .htaccess : <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] </IfModule> Should work...

Categories : PHP

AngularJS loading controllers from folder
You can put the your code where you wants to. If you put them into angular modules, angular will find it. So if you have a service in /app/common/services/foo.js like: angular.module('app').service('foo', function() { ... }); You can do this in the userController: angular.module('app').controller('UserController', function($scope, foo) { ... }); Here you see how I injected foo in our controller. Angular Dependency Injection system is smart enough to find your code no matter where you put them. You can also create different modules than app, you can have: angular.module('other').service('bar', function() { ... }); And where you define the app module, something like this: angular.module('app', []); You just need to add the new module there as a dependency, that is what the [] ar

Categories : Javascript

Dynamically Loading Controllers and ng-include
If i have understood you correctly what you can try would be to create a template view specifically to create a new leg. From the main controller implement some logic to show the template $scope.addLeg=function() { $scope.showAddLeg=true; } The AddLeg template view would load the controller and hence provide a mechanism to actually add new leg. The template would look like <script type="text/ng-template" class="template" id="addLegTemplate"> <div ng-controller='LegsController'> <!--html for adding a new leg--> </div> </script> You can include this template inside you main html using ng-if + ng-include. <div ng-if='showAddLeg'><div ng-include='addLegTemplate'/></div> Basically you can create multiple view and bind to s

Categories : Angularjs

Use controller method in all controllers sitewide
Put your method in the AppController's beforeFilter, beforeRender, afterFilter etc methods. As long as you inherit your Controller Classes from your AppController the method is available application wide.

Categories : PHP

Switching view controllers without navigation controller
Using UINavigationController as a rootViewController is a good tone of creating iOS application. As i understand unwanted view elements is a navigationBar? You can just hide it manually, setting: [self.navigationController setNavigationBarHidden:YES]; And about your case, if you want to change you current viewController(targeting iOS 6), you can just present new one: [self presentViewController:login animated:YES completion:nil]; or add child (Here is nice example to add and remove a child): [self addChildViewController:login]; Why to set UINavigationController as a root? 1) First of all it makes your application visible viewcontrollers to be well structured. (Especially it is needed on iPhone). You can always get the stack and pop (or move) to any viewController you want. 2)

Categories : Iphone

Testing Angular Controllers: Controller Not Defined
Same way you did the last one describe('evCalcApp controllers', function(){ beforeEach(module('evCalcApp.controllers')); var scope, ctrl, ctrl2; beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); scope2 = $rootScope.$new(); ctrl = $controller('MyMileageCalcController', {$scope: scope}); ctrl2 = $controller('MyCtrl2', {$scope: scope2}); }));

Categories : Javascript

EmberJS - Access application controller from other controllers
Application Controller: App.ApplicationController = Ember.ObjectController.extend({ findPersonById: function(id) { ..... .... } }); Below is the way to access application controller function inside comments controller. Comments Controller App.CommentsController = Ember.ArrayController.extend({ needs: ["application"], getComments: function() { var person = this.get("controllers.application").findPersonById(id); .... .... } });

Categories : Ember Js

ASP.NET MVC Controller extension method to make Log available to all controllers
Try //inside a controller's method this.Log().Info("hello"); You're not adding a property Log, you're adding an extension method Log(). There's no such thing as "extension properties".

Categories : C#

MVYSideMenu using Navigation Controller in all view controllers iOS
You are adding the button before the view controller is loaded, you should add it after loading the view in your content view controller. @implementation YPProfileViewController --------------- - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. UIButton *iwantView = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 30, 30)]; [iwantView setBackgroundColor:[UIColor blackColor]]; [iwantView addTarget:self action:@selector(openMenu) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc] initWithCustomView:iwantView]; } Anyway I just added a method to add a menu button on the navigation bar more easily. - (void)viewDidLoad { [super viewDidLoad];

Categories : Iphone

How can I test angularjs controllers that have been created with module().controller?
You test them the same exact way. Make sure you're loading the module with the controller in your tests via the module function in the ngMock module. Something like this: beforeEach(module('testAngularApp'));

Categories : Javascript

User defined controller(To be inheritted by all controllers) with instantiated DbContext
You might need to dispose the context: public class MyAppController : Controller { public FooEntities Db { get; set; } public MyAppController() { Db = new FooEntities(); } protected override void Dispose(bool disposing) { this.Db.Dispose(); base.Dispose(disposing); } } But if you are doing things properly and working with abstractions (instead of hardcoding specific instances of your DB context into the controller constructor), it's the responsibility of your Dependency Onjection framework to control the lifetime of your context. Ideally they should be per-request. In this case your controller code will look like this: public class MyAppController : Controller { protected IUnitOfWork UoW { get; private set; } public MyApp

Categories : C#

Best practices for handling changes to the UINavigationItem of child view controllers in a container controller?
Have you considered NOT wrapping your container view controller in a UINavigationController and just adding a UINavigationBar to your view? Then you can push your child view controller's navigation items directly to that navigation bar. Essentially your container view controller would replace a normal UIViewController.

Categories : IOS

How to remove split second white screen between dismissing a view controller and loading a new view controller
check out this code:- self.view.backgroundColor = [UIColor clearColor]; self.modalPresentationStyle = UIModalPresentationCurrentContext; [self presentModalViewController:modalVC animated:YES];

Categories : IOS

JavaScript file not loading - syntax error
I think there is an issue with your javascript. Try the code below JS Fiddle: http://jsfiddle.net/jonocairns/Z2C9Y/1/ "use strict"; function addField() { $('form input:file').last().after('<p><input type="file" name="files[]" id="file" /><br /></p>'); };

Categories : Javascript

JPA - Getting MySQL syntax error when loading the one-to-many relation of an entity
The problem is probably caused by the column precision. This is a reserved word (according to MySQL). You can check this answer for a workaround

Categories : Java

Variable syntax in controller
You can use Ruby interpolation: class PdfController < ApplicationController def index @html = %Q{ <html> #{ VARIABLE } </html> } end end

Categories : Ruby On Rails

Receiving Syntax Error When Adding Controller
Actually i am not familiar in this .but you can refer this links.....hope this link will helpful. Hartl Tutorial: 3.2 Error when i try and clean up my code displaying two renders in staticpage home in rails 3

Categories : Ruby On Rails

Syntax error in Ruby Post Controller
You have missed "if" in the update action. def update if @post = Post.find(params[:id]) redirect_to topics_url, notice: "Updated post." else render :edit end end

Categories : Ruby On Rails

Understanding/clarifying view controller syntax
A lot of these questions are more generic than just within the context of view controllers. [super methodName] calls the superclasses implementation of the method named methodName. In your case, Apple has written some code (that we don't have access to) in UIViewController's viewWillDisappear: method. ALWAYS call super when overriding a method from a superclass. Note that viewWillDisappear: is just callback triggered whenever the view is set to disappear. My guess is that the super implementation of this method forwards this callback down to child view controllers, especially in the case of standard container classes like UINavigationController and UITabBarController. The type casting really doesn't seem necessary, you can always call methods without compiler errors/warnings if the re

Categories : IOS

How to use scope variables with the "Controller as" syntax in Jasmine?
The solution is to use the "controller as" syntax when instantiating your controller in your test. Specifically: $controller('configCtrl as config', {$scope: scope}); expect(scope.config.status).toBe("any"); The following should now pass: describe('ConfigCtrl', function(){ var scope; beforeEach(angular.mock.module('busybee')); beforeEach(angular.mock.inject(function($controller,$rootScope){ scope = $rootScope.$new(); $controller('configCtrl as config', {$scope: scope}); })); it('should have text = "any"', function(){ expect(scope.config.status).toBe("any"); }); });

Categories : Angularjs

How do I keep a transparent view controller loaded overtop of all my other view controllers?
You could add the view controller as a child of the root view controller and add its view as a subview. You'll need to do some tampering with hitTest to ensure that touches get passed on to the sibling views.

Categories : Iphone

ngRoute set base url for all routes
Setting the <base> HTML5 tag might help. From the documentation here: Relative links Be sure to check all relative links, images, scripts etc. You must either specify the url base in the head of your main html file (<base href="/my-base">) or you must use absolute urls (starting with /) everywhere because relative urls will be resolved to absolute urls using the initial absolute url of the document, which is often different from the root of the application. Running Angular apps with the History API enabled from document root is strongly encouraged as it takes care of all relative link issues.

Categories : Angularjs

Yii - Dynamically Loading a Controller
create a page object (id, title, slug, description, image) create an article object (id, pageId, title, slug, content) configure your urlManager: '<pageSlug>/<articleSlug>' => 'article/view' in your ArticleController->ViewAction evaluate Yii::app()->request->getParam('pageSlug') Yii::app()->request->getParam('articleSlug') to find the right article for that page

Categories : PHP

Ext JS 4.2.1 loading controller - best practice
You can load all the controllers at start-up. See below link, tested 1000 controllers and it's fast: Best practices for initializing and deconstructing controllers Your best bet for a fast application is to have all the required files minimized and compressed into one file, using sencha cmd. You shouldn't load data into a view in init as the ui isn't loaded yet, can do it on onLoad if you like. I would load a view's data in afterrender or perhaps activated events. Ideally, you would use a modular approach, where you call an init() method on a module which requires the controllers, views, and models for that module.

Categories : Javascript

syntax to send list of models from a view to controller
You only can submit one model to a controller. However the model can contain lists of objects. For example; public class myModel { public string Foo { get; set; } public string Wong { get; set; } public List<text_boxes> TextBoxes { get; set; } } public class text_boxes { public name { get; set; } public blah { get; set; } }

Categories : C#

Why is Navigation View Controller returning zero View Controllers?
If the segue to view controller B is not a push segue, view controller B will not be in the stack of view controllers owned by the navigation controller. Therefore, [self navigationController] will be nil when called against view controller B. If you need view controller B to be in the stack automatically, you must change the segue to a push segue. Alternatively, you can manually add the controller to the stack.

Categories : IOS

asynchronous loading controller's code
try calling $controllerProvider.register to create your controller. I would also call $apply() on the $rootScope after resolving the deferred because without it, the view does not seem to appear: load: function($q, $rootScope){ var dfrd = $q.defer(); require(['view1'],function(){ dfrd.resolve(); $rootScope.$apply(); }) return dfrd.promise; } http://plnkr.co/edit/fe2Q3BhxPYnPmeiOORHP in addition, here is a good post: http://weblogs.asp.net/dwahlin/archive/2013/05/22/dynamically-loading-controllers-and-views-with-angularjs-and-requirejs.aspx

Categories : Angularjs

loading a view via function in controller
What you need to do is add the route for that as a child of the index() method's children Open /catalog/controller/product/product.php and find this code at the bottom of the index() method $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header' ); and add your route, which would be 'product/product/sizes' for your sizes() method $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header', 'product/product/sizes' ); And then in your template, you just need to use <?php echo $sizes; ?> wherever you want it to go

Categories : PHP

AngularJS Dynamic loading a controller
Re-reading this article http://ify.io/lazy-loading-in-angularjs/ suggested to keep a $contentProvider instance inside Angular App. I came up with this code in my app.js demoApp.config(function ($controllerProvider) { demoApp.controller = $controllerProvider.register; }); It enables me to write my controller as expected in a external javascript file : angular.module("demoApp").controller('MouseTestCtrlA', fn); Hope this can help !

Categories : Angularjs

iOS presentViewController View Controller not Fully Loading
MyModalViewController *mMVC = [[MyModalViewController alloc] init]; UINavigationController *mMNavVC = [[UINavigationController alloc] initWithRootViewController:mMNavVC]; mMNavVC.navigationBar.barStyle = UIBarStyleBlackOpaque; [[[app window] rootViewController].navigationController pushViewController: mMNavVC animated:YES]; [mMVC release]; [mMNavVC release];

Categories : IOS

Loading time storyboard controller is very long
Ok i found my problem: DTHTMLAttributedStringBuilder *stringBuilder = [[DTHTMLAttributedStringBuilder alloc] initWithHTML:data options:builderOptions documentAttributes:nil]; NSAttributedString *attrString = [stringBuilder generatedAttributedString]; generatedAttributedString generated lag. I found this problem by Time Profiler ( thanks for Fogmeister). So i remove this problem by generate fake content before initialize viewcontroller: NSString *html = @"<html>fake content</html>"; NSData *data = [html dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *builderOptions = @{

Categories : Iphone

dynamically loading the controller in angularjs $routeProvider
I have been attempting this same thing. One solution I've found is to do this inside your routeProvider: $routeProvider .when("/Dashboards/:dashboardName",{ templateUrl:function(params) { return "Dashboards/" + params.dashboardName; }, controller: 'dynamicController' }); And then you do your calculation for what "pseudo-controller" (for lack of a better name) to load inside of the "dynamicController" definition. var controllers = { unoController: function($scope, $routeParams, $rootScope) { // Do whatever }, dosController: function($scope, $routeParams, $rootScope) { // Whatever for this controller } } app.controller('dynamicController', ['$scope', '$routeParams', '$rootScope', function($scope, $routeParams, $r

Categories : Javascript

Loading a controller from another module in CodeIgniter HMVC
It seems that the module can be loaded without specifying the controller name only if the controller name matches the module name : Controllers can be loaded as class variables of other controllers using $this->load->module('module/controller'); or simply $this->load->module('module'); if the controller name matches the module name https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/overview Try to load the module like that : $this->load->module('templates/home');

Categories : PHP

Issue loading View Controller from UITabBarController
It looks like -viewDidLoad is getting called before your view controller stack is added to the window. Two things you could try are: Delaying until the next time through the run loop (this should give the view controllers time to get in place) [self performSelector:@selector(loadLogin) withObject:self afterDelay:0];. This method won't allow you to call a method with two arguments directly You could use -presentViewController: animated: completion:. This will cause your login controller to slide in from the bottom.

Categories : IOS

View Controllers in view Controller and orientation iOS
You need to subclass the UINavigationController like this. .H #import <UIKit/UIKit.h> @interface UINavigationController (Rotation) - (BOOL)shouldAutorotate; - (NSUInteger)supportedInterfaceOrientations; @end .M #import "UINavigationController+Rotation.h" @implementation UINavigationController (Rotation) - (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { if ([self visibleViewController] && [[self visibleViewController] isKindOfClass:[B class]]) { return UIInterfaceOrientationMaskAll; } return UIInterfaceOrientationMaskPortrait; } @end

Categories : Iphone

Force AngularJS service to return data before loading controller
Your userInfo service has to return the promise returned by $http. That promise will then be injected into your controller, and the view will be updated as soon as the promise successfully resolves. If you don't want the view to be rendered at all before userInfo resolves, you should set a resolve property on your route, and inject your service there: $routeProvider.when('/profile', { templateUrl: 'profile', controller: userProfile, resolve: { userInfoData: function ($q, userInfo) { return userInfo; } } }); Then just inject userInfoData into your controller in place of the userInfo service.

Categories : Javascript

How to show loading message when making a ajax call in controller
If you want, you can invoke the javascript functions from the controller itself by using WebView.execute_js(), http://docs.rhomobile.com/rhodesapi/webview-api#executejs Here is how you can achieve this, WebView.execute_js("LoadingMessage();") result = Rho::AsyncHttp.get( :url => "http://www.example.com/API-vs-1" ) WebView.execute_js("HideMessage();") @get_result = res["body"] You can give this a try, hope this helps you.

Categories : Ajax

AngularJS + jQuery Flot + Loading data with http.get from controller
And the answer to my own question: scope.$watch(attrs.ngModel, function(v){ if(v) { chart = $.plot(elem, v, options); elem.show(); } }); This was tripping scope.$watch up: var data = scope[attrs.ngModel]; In this case should be simply attrs.ngModel.

Categories : Jquery

Does SpringMVC supports loading of tile definitions without controller methods
You can use a combination of org.springframework.web.servlet.handler.SimpleUrlHandlerMapping & org.springframework.web.servlet.mvc.UrlFilenameViewController: SimpleUrlHandlerMapping gives the ability to route an URL directly to a controller, UrlFilenameViewController transform the received URL directy into a view name (e.g. URL: /test.html → View name: test). Hereunder, the required Spring configuration: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www

Categories : Spring

Excessive lag when loading view controller containing Core Plot graph
Is maxDailyCaloriesInDataset large? The default axis labeling policy puts tick marks and labels one unit apart along the axis. If the yRange is large, this creates a lot of overlapping labels, which can be very slow. Depending on the requirements of your app, either increase the majorIntervalLength so it doesn't make so many labels, or change the labeling policy. CPTAxisLabelingPolicyAutomatic and CPTAxisLabelingPolicyEqualDivisions would be good choices.

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.